Cerebrate is a Man-in-the-Middle (MITM) MCP server designed to intelligently expose MCP functionalities from multiple downstream servers, optimizing token usage for AI client applications.
Cerebrate acts as both an MCP client and server, intercepting and selectively exposing tools and resources from other MCP servers. This approach reduces unnecessary token consumption by providing only relevant functionalities to connected clients.
- MITM Architecture: Positions itself between AI client apps and MCP servers.
- Selective Exposure: Dynamically enables tools based on client requests.
- Security:
- Authentication codes (
ck-{nanoid}) with AES-256-GCM encryption - SQLite storage with record-level encryption
- Environment-based key management
- Authentication codes (
- Port Configuration: Defaults to 3878, configurable via
PORTenvironment variable or arguments. - Type Safety: Strict TypeScript with 99%+ test coverage.
(AI Client App) --(MCP Protocol)--> (Cerebrate MCP Server)
--> (Cerebrate MCP Clients) --(MCP Protocol)--> (Other MCP Servers)
To install dependencies:
bun install- Start Cerebrate as a local MCP server.
- It pre-connects to registered MCP servers to gather capabilities.
- Connect your AI client app using the required authentication code.
- Request tool activations and executions as needed.
To run the project:
bun run [entry-point]- Implement API call reverse proxy endpoints to extract magic words and append relevant tools.