Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modelcontextprotocol/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ classifiers = [
]

dependencies = [
"fastapi>=0.116.1",
"fastmcp==2.11.0",
"pyatlan>=6.0.1",
]
Expand Down
15 changes: 14 additions & 1 deletion modelcontextprotocol/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
parse_list_parameter,
)
from middleware import ToolRestrictionMiddleware
from fastapi.responses import JSONResponse
from fastapi import Request


mcp = FastMCP("Atlan MCP Server", dependencies=["pyatlan", "fastmcp"])
Expand All @@ -39,6 +41,17 @@
mcp.add_middleware(tool_restriction)


@mcp.custom_route("/health", methods=["GET"])
async def health(_: Request) -> JSONResponse:
"""
Health check endpoint for the MCP server.

Returns:
JSONResponse: A simple status message indicating the server is running.
"""
return JSONResponse(content={"status": "ok"})


@mcp.tool()
def search_assets_tool(
conditions=None,
Expand Down Expand Up @@ -714,7 +727,7 @@ def main():
"--port", type=int, default=8000, help="Port to run the server on"
)
parser.add_argument(
"--path", type=str, default="/", help="Path of the streamable HTTP server"
"--path", type=str, default="/mcp/", help="Path of the streamable HTTP server"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also any specific reason for this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MCP server’s endpoint is mounted at /mcp/ for Streamable HTTP transport and /sse/ for SSE transport if there is no argument
Link

, so this helps standardise things
also /health does'nt work if mcp server is also running at root

Copy link
Member

@firecast firecast Sep 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it standardise things? /health should work no matter what the base path is

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

The default for fastmcp if we dont pass the default argument as / is /mcp/
and /health doesnt work if mcp is run at root because if fastmcp server is started at / as
base path then any end point after / will go to fastmcp standard

this happens when theyre at the same path

image

When FastMCP runs at the root path (/), all HTTP requests go through the MCP protocol handler first, which requires the mcp-session-id header.

)
args = parser.parse_args()

Expand Down
Loading