fix(mcp): migrate to standalone fastmcp package to resolve official SDK v2 breaking change (#15)
This commit is contained in:
1 parent
663e375ff3
commit
ca3ba01f36
3 files changed
+11
-4
No files matched your search
+1
-1
@@ -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",
|
||||
]
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
Reference in new issue
Block a user