feat: add basic MCP server with ping tool

This commit is contained in:
daniel
2025-06-28 23:44:31 +02:00
parent 67dbb99501
commit ba77019291
2 changed files with 32 additions and 50 deletions

23
src/mcp_cordra/server.py Normal file
View File

@@ -0,0 +1,23 @@
"""MCP server for Cordra digital object repository."""
import asyncio
from mcp.server.fastmcp import FastMCP
# Initialize the MCP server
mcp = FastMCP("mcp-cordra")
@mcp.tool()
async def ping() -> str:
"""Simple ping tool to test server connectivity."""
return "pong"
def main() -> None:
"""Main entry point for the MCP server."""
asyncio.run(mcp.run())
if __name__ == "__main__":
main()