MCP Server Management
Model Context Protocol server lifecycle, OAuth 2.1 discovery, provider-managed runtimes, and tool catalog
Overview
Beep.AI.Server implements the Model Context Protocol (MCP) for standardized tool and resource access by AI agents. The MCP service manages server lifecycle, OAuth 2.1 authentication, provider-managed runtimes, and tool discovery.
Core Services
| Service | Key Function | Responsibility |
|---|---|---|
utils/mcp_environment.py | get_mcp_env() | MCP environment lifecycle and package management |
utils/mcp_runtime_bridge.py | get_mcp_runtime_bridge() | Bridge between MCP servers and agent frameworks |
utils/mcp_server_manager.py | MCPServerManager | Server lifecycle: create, start, stop, configure, list tools |
utils/managed_mcp_runtime_catalog.py | Provider-managed runtimes | Pre-configured MCP runtime templates for common providers |
Route Blueprints
| Blueprint | URL Prefix | Purpose |
|---|---|---|
mcp_page_routes | /admin/mcp | Overview, templates, server create/edit, detail pages (Phased: A=setup, B=packages, C=servers list) |
mcp_api_server_routes | /admin/mcp/api/* | Server CRUD, tool listing, transport configuration |
mcp_api_environment_routes | /admin/mcp/api/* | Environment status, create-env, install-packages |
mcp_api_managed_provider_routes | /admin/mcp/api/* | Provider-managed runtime configuration |
mcp_catalog_api_routes | /admin/mcp/api/catalog | Tool discovery from registered servers |
mcp_registry_routes | /mcp/registry | Public MCP registry access for external clients |
mcp_oauth | /.well-known/oauth-protected-resource | OAuth 2.1 well-known discovery + OpenID configuration |
OAuth 2.1 Well-Known Discovery
MCP OAuth endpoints publish standard well-known URIs:
/.well-known/oauth-protected-resource— Protected resource metadata/.well-known/openid-configuration— OpenID Connect discovery document
MCP Server Catalog
Pre-built MCP server definitions live in mcp_servers_catalog/. These can be registered as managed runtimes, configured with provider settings, and bound to agent frameworks through the MCP Bridge.