Skip to content

Conversation

@Haniehz1
Copy link
Contributor

@Haniehz1 Haniehz1 commented Nov 3, 2025

Added deployment patterns and examples for FastMCP and MCPApp. Updated configuration details and clarified usage scenarios.

Summary by CodeRabbit

  • Documentation
    • Replaced old example with a "Choosing your deployment pattern" section presenting FastMCP and MCPApp side-by-side
    • Expanded MCPApp deployment guidance, added optional resource endpoint, updated code samples and configuration to show MCPApp flow
    • Renamed and reorganized cloud deployment content, added docstrings to examples
    • Updated upgrade path, tooling notes, and final deployment/operation guidance to reflect dual-pattern options and future workflows

Added deployment patterns and examples for FastMCP and MCPApp. Updated configuration details and clarified usage scenarios.
@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Walkthrough

Replaces the prior FastMCP-focused example with a dual-pattern "Choosing your deployment pattern" section describing FastMCP and MCPApp, updates code samples/imports to the MCPApp flow, adds optional resource endpoint and docstrings, and revises configuration, upgrade, and deployment guidance for both patterns. (50 words)

Changes

Cohort / File(s) Change Summary
Documentation: deployment patterns guide
docs/cloud/mcp-agent-cloud/deploy-mcp-server.mdx
Replaced "FastMCP example" with "Choosing your deployment pattern"; documented two patterns (FastMCP, MCPApp) and decorators/features/comparisons; migrated code samples to MCPApp-based flow and updated imports; added optional resource endpoint; added docstrings to example functions; reorganized sections and updated YAML/config guidance.

Sequence Diagram(s)

(omitted — changes are documentation-only and do not alter runtime control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify code example correctness (imports, decorators, CONFIG_PATH usage).
  • Check docstrings and example function signatures.
  • Confirm accuracy of deployment pattern descriptions and YAML snippets.

Possibly related PRs

Suggested reviewers

  • saqadri
  • andrew-lastmile

Poem

🐰 In docs I hopped to shift the map,
Two patterns now replace the trap.
FastMCP and MCPApp shine bright,
Examples polished, strings made right.
Hop on—deploy with carrot-light ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: updating documentation for MCP Agent Cloud server deployment with new deployment patterns and examples.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch server-deployment-docs

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 776c5e7 and 4c9b7d3.

📒 Files selected for processing (1)
  • docs/cloud/mcp-agent-cloud/deploy-mcp-server.mdx (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-28T15:07:10.015Z
Learnt from: saqadri
Repo: lastmile-ai/mcp-agent PR: 386
File: src/mcp_agent/mcp/mcp_server_registry.py:110-116
Timestamp: 2025-08-28T15:07:10.015Z
Learning: In MCP server registry methods, when client_session_factory parameters are updated to accept additional context parameters, ensure the type hints match what is actually passed (Context instance vs ServerSession) and that the default factory (MCPAgentClientSession) can handle the number of arguments being passed to avoid TypeError at runtime.

Applied to files:

  • docs/cloud/mcp-agent-cloud/deploy-mcp-server.mdx
📚 Learning: 2025-07-22T18:59:49.368Z
Learnt from: CR
Repo: lastmile-ai/mcp-agent PR: 0
File: examples/usecases/reliable_conversation/CLAUDE.md:0-0
Timestamp: 2025-07-22T18:59:49.368Z
Learning: Applies to examples/usecases/reliable_conversation/examples/reliable_conversation/src/**/*.py : Use mcp-agent's Agent abstraction for ALL LLM interactions, including quality evaluation, to ensure consistent tool access, logging, and error handling.

Applied to files:

  • docs/cloud/mcp-agent-cloud/deploy-mcp-server.mdx
🔇 Additional comments (5)
docs/cloud/mcp-agent-cloud/deploy-mcp-server.mdx (5)

27-41: Excellent organization of deployment patterns—addresses previous reviewer concerns.

The new "Choosing your deployment pattern" section (table + key differences) clearly distinguishes when to use FastMCP vs MCPApp and resolves the question about MCPApp being a requirement. Line 40 explicitly states that both patterns require MCPApp for cloud deployment, and the key differences (lines 36–39) explain the decorator behavior and upgrade path well.


46-72: FastMCP example correctly shows MCPApp wrapper—good docstring and optional resource example.

The example properly demonstrates that FastMCP requires an MCPApp wrapper for cloud deployment. The added docstring on hash_text (line 62) improves clarity, and the commented-out resource endpoint (lines 68–71) is helpful for showing what's possible without cluttering the main pattern.


85-118: MCPApp pattern is clear and simpler—docstrings and upgrade guidance enhance usability.

The direct MCPApp approach (without FastMCP wrapper) is more intuitive, and docstrings on both tool functions improve clarity. Line 118's note about adding Temporal workflows later without changing the deployment command is valuable context and directly addresses the asyncio vs temporal differentiator from prior review feedback.


74-81: Configuration sections are correct—identical asyncio setup appropriate for both initial patterns.

Both FastMCP and MCPApp configurations are correctly identical (asyncio execution engine). The upgrade guidance at line 118 already explains that users update to execution_engine: temporal when adding workflows to MCPApp, so the identical configs here support the pattern of starting simple and layering durability when needed.

Also applies to: 109-116


176-198: Upgrade path clearly demonstrates evolution from FastMCP to MCPApp with workflows.

The code example (lines 181–196) shows a practical migration path: start with a FastMCP tool, then wrap in MCPApp to add workflows (@app.async_tool, @app.workflow) while maintaining the same tool name. Line 198's note that "clients keep working while gaining new capabilities" reinforces the non-breaking upgrade story, which is essential for user confidence.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

from mcp_agent.app import MCPApp

# Configuration path
CONFIG_PATH = (Path(__file__).parent / "mcp_agent.config.yaml").resolve()
Copy link
Contributor

Choose a reason for hiding this comment

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

is this correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, not needed!

`mcp_agent.secrets.yaml` remains optional unless your server calls external APIs.

## MCPApp-only example (no workflows)
## Deploying an MCPApp as a server
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't both options an MCPApp?

app = MCPApp(
name="markdown-tools",
description="Text processing tools",
settings=str(CONFIG_PATH),
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above

```

Because there are no workflows, the app behaves like a standard MCP server but you can add Temporal-backed workflows later without changing the deployment process.
This app behaves like a standard MCP server but you can add Temporal-backed workflows later (using `@app.async_tool` and `@app.workflow`) without changing the deployment process.
Copy link
Contributor

Choose a reason for hiding this comment

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

is this a true statement?

Updated the description and clarified deployment process for cloud applications after Andrew's review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants