-
Notifications
You must be signed in to change notification settings - Fork 7
Add MCP (Model Context Protocol) integration to Application SDK #698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📜 Docstring Coverage ReportRESULT: PASSED (minimum: 30.0%, actual: 75.8%) Detailed Coverage Report
|
📦 Trivy Vulnerability Scan Results
Report Summary
Scan Result Details✅ No vulnerabilities found during the scan for |
📦 Trivy Secret Scan Results
Report Summary
Scan Result Details✅ No secrets found during the scan for |
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified FilesNo covered modified files...
|
🛠 Full Test Coverage Report: https://k.atlan.dev/coverage/application-sdk/pr/698 |
@AdvitXAtlan Let's refactor it in the following direction
|
Core Features: - Added @mcp_tool decorator for marking activities as MCP tools - Added MCPServer class that auto-discovers decorated activities - Enhanced BaseApplication with enable_mcp parameter and MCP methods - Added mcp optional dependency group Architecture: - Activities marked with @mcp_tool are automatically exposed - MCPServer reuses existing activity discovery logic from workflows - Clean integration: apps just add decorators + enable_mcp=True - No manual MCP server code needed in individual apps
- Add @mcp_tool decorator for marking activities as MCP tools - Implement MCPServer class with automatic tool discovery - Mount FastMCP server on FastAPI at /mcp endpoint - Support streamable HTTP transport for AI agent integration - Enable MCP through BaseApplication enable_mcp flag - Add FastMCP 2.0 as optional dependency - Support Claude Desktop integration via npx mcp-remote
- Add Pydantic BaseModel automatic parameter expansion for AI-friendly tools - Implement comprehensive unit test suite for MCP integration (37 tests) - Fix @mcp_tool decorator to support both @mcp_tool and @mcp_tool() syntax - Restructure test folders to mirror source code structure per standards - Add FastMCP integration test when library is available - Fix parameter ordering in Pydantic expansion (required before optional) - Improve type comparisons and remove unused imports per linting
8fc9917
to
6f5534c
Compare
# ... activity implementation unchanged ... | ||
""" | ||
|
||
def decorator(f): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a functools.wraps
here
@mcp_tool | ||
async def simple_activity(self, param: str) -> str: | ||
pass | ||
|
||
@mcp_tool(description="Fetch random GIF from Giphy API") | ||
async def fetch_gif(self, search_term: str) -> str: | ||
# ... activity implementation unchanged ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the >>>
prefix to the lines in this section of the docstring indicating the python REPL.
You can find an example here
Example:
This should fix the failing docs action
Model Context Protocol (MCP) Integration for Application SDK
Summary
This PR adds comprehensive Model Context Protocol (MCP) support to the Atlan Application SDK.
Core Features:
Architecture:
Migration Guide
For existing applications wanting to add MCP support:
Install MCP dependencies:
pip install "atlan-application-sdk[mcp]"
Decorate activities:
Enable MCP in application:
Changelog
fastmcp>=2.0.0
in[mcp]
extra@mcp_tool
decorator inapplication_sdk.decorators.mcp_tool
MCPServer
class inapplication_sdk.servers.mcp.server
BaseApplication
withenable_mcp
parameter/mcp
endpointAdditional context (e.g. screenshots, logs, links)
Checklist
Copyleft License Compliance