Skip to content

Mcp/dev#88

Merged
vik-rant merged 15 commits intodevfrom
mcp/dev
Jul 16, 2025
Merged

Mcp/dev#88
vik-rant merged 15 commits intodevfrom
mcp/dev

Conversation

@pankhuri-mt
Copy link
Collaborator

Overview
This PR enables both the FastAPI server and the FastMCP server to exist independently, while also providing a feature to mount the MCP app on the same FastAPI app if desired.
The changes are minimal and focused, making it easy to maintain separation or combine the two servers as needed.
Key Changes

  • Added the ability to mount the MCP app (mcp_app) onto the main FastAPI app, using a combined lifespan for proper startup and shutdown management.
  • The MCP client is currently implemented in the sample script (samples/services/echo_mcp_service.py). We can consider generating a dedicated MCP client for available tools in the future.
  • Endpoints defined as class functions can be exposed both as standard FastAPI endpoints and as MCP tools or as mcp tools only

@JeremyWurbs JeremyWurbs added the mindtrace-core Issues raised from core module in mindtrace package label Jul 14, 2025
Copy link
Contributor

@JeremyWurbs JeremyWurbs left a comment

Choose a reason for hiding this comment

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

I like the MCP integration here.

I would be okay with it more or less as is once tests are added in. Perhaps we can think of an updated official list of endpoints to support, particularly making endpoint discovery match the same format for tool discovery, but that doesn't have to be in this initial PR.

# Add the reverse_message tool directly (not as an endpoint)
self.add_tool("reverse_message", reverse_message)

def echo(self, payload: EchoInput) -> EchoOutput:
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed the MCP pulls the docks from the class docstrings, so it might be good to make sure all of our classes / endpoint / tool methods have docstrings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree, in the next PR, we can also have a warning to flag the functions with missing doc strings.

@JeremyWurbs JeremyWurbs added this to the 0.2.0 (July 2025 Release) milestone Jul 15, 2025
@vik-rant vik-rant merged commit e4ef488 into dev Jul 16, 2025
2 of 4 checks passed
Yasserelhaddar pushed a commit that referenced this pull request Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mindtrace-core Issues raised from core module in mindtrace package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants