Add mypy to pre-commit (#43)

* Add mypy to pre-commit

* Enable GH action to run pytest on Python 3.13
This commit is contained in:
Kacper Łukawski
2025-04-10 15:03:48 +02:00
committed by GitHub
parent 75d605deff
commit ecba1ddce6
6 changed files with 21 additions and 14 deletions

View File

@@ -56,6 +56,10 @@ class QdrantMCPServer(FastMCP):
return f"<entry><content>{entry.content}</content><metadata>{entry_metadata}</metadata></entry>"
def setup_tools(self):
"""
Register the tools in the server.
"""
async def store(
ctx: Context,
information: str,
@@ -63,7 +67,7 @@ class QdrantMCPServer(FastMCP):
# The `metadata` parameter is defined as non-optional, but it can be None.
# If we set it to be optional, some of the MCP clients, like Cursor, cannot
# handle the optional parameter correctly.
metadata: Metadata = None,
metadata: Metadata = None, # type: ignore
) -> str:
"""
Store some information in Qdrant.
@@ -86,8 +90,9 @@ class QdrantMCPServer(FastMCP):
async def store_with_default_collection(
ctx: Context,
information: str,
metadata: Metadata = None,
metadata: Metadata = None, # type: ignore
) -> str:
assert self.qdrant_settings.collection_name is not None
return await store(
ctx, information, self.qdrant_settings.collection_name, metadata
)
@@ -129,6 +134,7 @@ class QdrantMCPServer(FastMCP):
ctx: Context,
query: str,
) -> List[str]:
assert self.qdrant_settings.collection_name is not None
return await find(ctx, query, self.qdrant_settings.collection_name)
# Register the tools depending on the configuration