feat(mcp): Add MCP server for Corrigo SDK via FastMCP 3.0#1
Closed
feat(mcp): Add MCP server for Corrigo SDK via FastMCP 3.0#1
Conversation
Implements a full MCP server exposing the Corrigo Python SDK as MCP
primitives for AI agent integration (voice agents, dispatch tools).
Server foundation:
- FastMCP 3.0 with lifespan-managed CorrigoClient
- SDK exception → ToolError/ResourceError mapping with mask_error_details
- Attribute descriptor pre-caching to avoid N+1 HTTP calls
- Tag-based audience separation (internal vs customer-facing)
22 tools:
- Work order lifecycle (create, assign, pickup, start, complete, cancel,
hold, pause, reopen, update) + 5 listing tools
- Entity CRUD (customer, contact, employee, location)
- Generic query_entities with Django-like filter syntax
- search_locations with suggestion on empty results
8 resource templates:
- corrigo://work-orders/{id}, corrigo://work-orders/number/{number}
- corrigo://customers/{id}, corrigo://customers/{id}/assets
- corrigo://locations/{id}, corrigo://locations/{id}/attributes
- corrigo://employees/{id}, corrigo://invoices/{id}
6 prompt templates:
- triage_work_order, diagnose_work_order (internal ops)
- customer_overview (account management)
- work_order_status (customer-facing, field-filtered)
- report_issue, troubleshoot_equipment (voice agent)
Packaging:
- pip install corrigo[mcp] optional dependency
- corrigo-mcp CLI entry point
- python -m corrigo.mcp support
- Requires Python >=3.10 (FastMCP requirement)
63 tests with full in-memory MCP client testing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mark all implemented phases (1-6) as complete in the plan checkboxes. Quality gates verified: 63 tests pass, ruff clean, mypy clean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing — MCP server moved to its own repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pip install corrigo[mcp]optional dependency withcorrigo-mcpCLI entry pointArchitecture
Server foundation (
src/corrigo/mcp/server.py):@lifespanmanagesCorrigoClientlifecycle (env vars → auth → close on shutdown)AttributeDescriptorentities to avoid N+1 HTTP callshandle_sdk_error()maps all SDK exceptions toToolErrorwith customer-safe messagesmask_error_details=Trueprevents internal stack traces leaking to MCP clientsTools (22 total):
query_entities: generic query with Django-like filter syntax (__like,__gt, etc.)search_locations: name search with suggestion on empty resultsResources (8 URI templates):
corrigo://work-orders/{id},corrigo://work-orders/number/{number}corrigo://customers/{id},corrigo://customers/{id}/assetscorrigo://locations/{id},corrigo://locations/{id}/attributescorrigo://employees/{id},corrigo://invoices/{id}Prompts (6 workflow templates):
triage_work_order,diagnose_work_order,customer_overviewwork_order_status(field-filtered),report_issue,troubleshoot_equipmentTag-based audience separation:
internalvscustomer-facingtags on all primitives.Test plan
Client(mcp)patternuv run ruff checkpasses cleanuv run ruff format --checkpasses cleanPost-Deploy Monitoring & Validation
No additional operational monitoring required: this is a new optional module (
corrigo[mcp]) that does not affect existing SDK functionality. The MCP server is only activated when explicitly installed and run.