Skip to content

Commit 0829bec

Browse files
committed
Dependencies: Update to FastMCP 2.0
1 parent 5bafb38 commit 0829bec

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
standardizing on common naming conventions
66
- CLI: Added subcommand `cratedb-mcp serve` using Click, with
77
dedicated options `--transport` and `--port`
8+
- Dependencies: Updated to FastMCP 2.0. It significantly expands on 1.0 by
9+
introducing powerful client capabilities, server proxying & composition,
10+
OpenAPI/FastAPI integration, and more advanced features.
11+
See [FastMCP 2.0 and the Official MCP SDK].
12+
13+
[FastMCP 2.0 and the Official MCP SDK]: https://gofastmcp.com/getting-started/welcome#fastmcp-2-0-and-the-official-mcp-sdk
814

915
## v0.0.0 - 2025-05-16
1016
- Project: Established project layout

cratedb_mcp/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import httpx
2-
from mcp.server.fastmcp import FastMCP
2+
from fastmcp import FastMCP
33

44
from . import __appname__
55
from .knowledge import DocumentationIndex, Queries
@@ -10,7 +10,7 @@
1010
documentation_index = DocumentationIndex()
1111

1212
# Create FastMCP application object.
13-
mcp = FastMCP(__appname__)
13+
mcp: FastMCP = FastMCP(__appname__)
1414

1515

1616
def query_cratedb(query: str) -> list[dict]:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ dependencies = [
7474
"cachetools<6",
7575
"click<9",
7676
"cratedb-about==0.0.4",
77+
"fastmcp<3",
7778
"hishel<0.2",
78-
"mcp[cli]>=1.5.0",
7979
"pueblo==0.0.11",
8080
"sqlparse<0.6",
8181
]

tests/test_cli.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from unittest import mock
22

3-
import anyio
43
from click.testing import CliRunner
54

65
from cratedb_mcp import __version__
@@ -67,7 +66,7 @@ def test_cli_valid_default(mocker, capsys):
6766
6867
The test needs to mock `anyio.run`, otherwise the call would block forever.
6968
"""
70-
run_mock = mocker.patch.object(anyio, "run")
69+
run_mock = mocker.patch.object(mcp, "run_async")
7170

7271
# Invoke the program.
7372
runner = CliRunner()
@@ -79,7 +78,7 @@ def test_cli_valid_default(mocker, capsys):
7978

8079
# Verify the outcome.
8180
assert run_mock.call_count == 1
82-
assert run_mock.call_args == mock.call(mcp.run_stdio_async)
81+
assert run_mock.call_args == mock.call("stdio")
8382
assert mcp.settings.port == 8000
8483

8584

@@ -89,7 +88,7 @@ def test_cli_valid_custom(mocker, capsys):
8988
9089
The test needs to mock `anyio.run`, otherwise the call would block forever.
9190
"""
92-
run_mock = mocker.patch.object(anyio, "run")
91+
run_mock = mocker.patch.object(mcp, "run_async")
9392

9493
# Invoke the program.
9594
runner = CliRunner()
@@ -101,7 +100,7 @@ def test_cli_valid_custom(mocker, capsys):
101100

102101
# Verify the outcome.
103102
assert run_mock.call_count == 1
104-
assert run_mock.call_args == mock.call(mcp.run_streamable_http_async)
103+
assert run_mock.call_args == mock.call("streamable-http")
105104
assert mcp.settings.port == 65535
106105

107106

0 commit comments

Comments
 (0)