fix(mcp): migrate to standalone fastmcp package to resolve official SDK v2 breaking change (#15)

This commit is contained in:
i/o agent authored and GitHub committed 2026-08-12 14:08:06 -04:00
1 parent 663e375ff3
commit ca3ba01f36
3 files changed
+11 -4

No files matched your search

+1 -1
View File
@@ -8,7 +8,7 @@ dependencies = [
"httpx>=0.27.0",
"pydantic>=2.0",
"pydantic-settings>=2.0",
"mcp>=1.0.0",
"fastmcp>=2.0.0",
"starlette>=0.40.0",
"uvicorn>=0.30.0",
]
+1 -3
View File
@@ -5,7 +5,7 @@ import logging
from contextlib import asynccontextmanager
from typing import Any
from mcp.server.fastmcp import FastMCP
from fastmcp import FastMCP
from .client import NpmClient
from .config import NpmInstance, settings
@@ -57,8 +57,6 @@ mcp = FastMCP(
"npm-mcp",
instructions="MCP server for Nginx Proxy Manager - manage reverse proxy configurations",
lifespan=lifespan,
host=settings.mcp_host,
port=settings.mcp_port,
)
+9
View File
@@ -0,0 +1,9 @@
"""Tests for the server module and its FastMCP initialization."""
import pytest
def test_server_imports():
"""Ensure that the server and mcp instance can be imported without errors."""
from npm_mcp.server import mcp
assert mcp is not None
assert mcp.name == "npm-mcp"