-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Goal
Enterprise features and management UI
Tasks
Backend Implementation ✅ COMPLETE
- Add user_id to all MCP resources
- Implement public/private namespace scoping
- Audit trail for tool invocations
- Add health endpoint (
GET /metamcp/health) - Add audit listing endpoint (
GET /metamcp/audits) - AuditMiddleware for automatic tool call logging
- REST wrapper for MCP tools
- OpenAPI spec generation at
/metamcp/openapi.json
In Progress / Planned
- Role-based access control for endpoints (future enhancement)
- Auto-generate OpenAPI specs from MCP tools (manual for now)
- Swagger UI integration (OpenAPI JSON available for external viewers)
Frontend (Deferred to Phase 5)
- Extend Svelte frontend with MCP management views
- Namespace CRUD operations UI
- Tool enable/disable toggles
- Endpoint management dashboard
- Real-time server status display
Completed Features
Phase 4A - Multi-Tenancy & Compliance
Commit: 6ce6d3a
Persistence Layer
McpAuditRecordfor tool invocation trackingNamespaceVisibilityenum (Public/Private) with Private default- Audit trail methods:
save_audit,get_audit,list_audits,delete_audit list_namespaces_with_visibilityfor multi-tenancy support- OpenDAL-based audit storage
Middleware
AuditMiddlewarefor automatic tool call logging- Feature-gated with 'audit' feature flag
- Tracks: tool name, arguments, response, errors, latency
API Layer
get_mcp_healthendpoint with namespace/endpoint countslist_auditsendpoint (limit 100 recent records)- Visibility field in
CreateNamespaceRequest
Routes
GET /metamcp/health- Server health with countsGET /metamcp/audits- Recent audit trail
Phase 4B - REST API Wrapper
Commit: 3d5a1c3
API Module (terraphim_server/src/api_mcp_tools.rs)
list_tools_for_endpoint: Lists all tools for an endpointexecute_tool: Executes tool with JSON argumentscreate_proxy_from_namespace: Initializes McpProxy from config- Error handling for missing endpoints/namespaces
Routes
GET /metamcp/endpoints/{endpoint_uuid}/toolsPOST /metamcp/endpoints/{endpoint_uuid}/tools/{tool_name}
Integration
- Leverages
terraphim_mcp_proxyfor routing - Uses MCP persistence for lookups
- Supports all transports (STDIO, SSE, HTTP, OAuth)
Phase 4C - OpenAPI Documentation
Commit: 318f113
API Specification
- Complete OpenAPI 3.0 spec at
GET /metamcp/openapi.json - Documented paths, parameters, request/response schemas
- Ready for Postman/Insomnia/Swagger UI import
Type System
McpTool: OpenAPI-compatible tool wrapperMcpContentItem: Response content enumToolListResponse,ToolCallRequestPayload,ToolCallResponsePayload- All types implement
ToSchemafor documentation
Test Coverage
- Persistence: 6/6 tests passing (audit, visibility)
- MCP Proxy: 19/19 tests passing
- MCP Tools API: 7/7 tests passing
- Total: 32 tests passing ✅
Success Criteria
- Multi-user support with proper isolation (namespace visibility)
- Audit trail for compliance
- REST API for tool execution
- OpenAPI documentation
- High test coverage (32 tests)
- Web UI for managing MCP configuration (deferred to Phase 5)
Usage Examples
# List tools
curl http://localhost:8080/metamcp/endpoints/{uuid}/tools
# Execute tool
curl -X POST http://localhost:8080/metamcp/endpoints/{uuid}/tools/filesystem__read_file \
-H "Content-Type: application/json" \
-d '{"arguments": {"path": "/path/to/file"}}'
# Get OpenAPI spec
curl http://localhost:8080/metamcp/openapi.json > mcp-api.json
# Health check
curl http://localhost:8080/metamcp/health
# Audit trail
curl http://localhost:8080/metamcp/auditsTimeline
Week 7-8 (Backend completed ahead of schedule ✅)
Phase 4 COMPLETE - All backend features implemented with full test coverage.
Depends on: Phase 3 ✅
Metadata
Metadata
Assignees
Labels
No labels