Summary
I would like to propose an MCP server implementation that uses CockroachDB as its primary state store to provide:
- Durable server state
- Strong consistency through Raft replication
- Transactional idempotency for tool executions
- Safe retry semantics under concurrent workloads
- Horizontal scalability without relying on local process state
This proposal is intended as a standalone MCP server project that would later be published separately and referenced from the MCP Registry through a standard server.yaml entry.
Problem Statement
Many MCP server implementations rely on:
- Local in-memory state
- File-based persistence
- Non-idempotent callback execution
- Single-node storage assumptions
Under concurrent workloads or process restarts, these patterns can lead to:
- Duplicate tool execution
- Lost state after crashes
- Race conditions between concurrent requests
- Difficult horizontal scaling
As MCP adoption grows, there may be value in providing a reference architecture for stateful MCP servers that require stronger consistency guarantees.
Proposed Solution
Build a dedicated MCP server that uses CockroachDB as the system of record.
Durable State
All persistent state is stored in CockroachDB rather than local files or memory.
Idempotent Tool Execution
Each tool invocation is assigned an idempotency key.
The server records invocation state inside a transactional table before executing side effects.
This enables safe retries and prevents duplicate execution.
Serializable Transactions
Tool execution metadata is protected by CockroachDB's serializable transaction model, reducing race conditions and write conflicts.
Horizontal Scalability
Server instances remain stateless.
Multiple replicas can serve requests while sharing the same underlying CockroachDB cluster.
Architecture Overview
Core Components
- MCP Server Runtime
- CockroachDB Cluster
- Idempotency Layer
- Transaction Coordinator
- Health & Readiness System
- Horizontal Scaling Layer
Data Flow
- Client sends tool invocation.
- Server generates an idempotency key.
- Invocation metadata is written to CockroachDB.
- Transaction executes under serializable isolation.
- Result is persisted atomically.
- Duplicate requests return the stored result.
- Stateless replicas can safely serve future requests.
Intended Deliverables
A separate public repository containing:
- MCP server implementation
- Docker image
- CI/CD pipeline
- CockroachDB schema and migrations
- Deployment documentation
- Example production configuration
- Load-testing examples
The MCP Registry submission would only contain the registry metadata entry pointing to the implementation repository and published image.
Benefits
Reliability
- Survives process restarts
- Durable execution history
- Reduced risk of data loss
Consistency
- Serializable transactions
- Safe concurrent execution
- Predictable retry behavior
Scalability
- Stateless server replicas
- Horizontal scaling support
- Multi-region deployment capability
Operational Simplicity
- Centralized state management
- Simplified failover
- Standardized deployment patterns
Questions for Maintainers
-
Would a CockroachDB-backed MCP server be appropriate for inclusion in the MCP ecosystem?
-
Are there existing MCP servers that already address durable state and idempotent execution in a similar way?
-
Are there recommended patterns for documenting and registering stateful MCP servers within the registry?
-
Would maintainers prefer this as:
- A standalone MCP server implementation
- A reference architecture/example project
-
Are there any MCP Registry requirements that should influence repository structure, image publishing, or configuration design?
Additional Context
The goal is not to modify MCP Registry itself.
The goal is to provide a reusable MCP server implementation that demonstrates:
- Strong consistency
- Distributed durability
- Safe concurrency
- Operational scalability
- Production-ready deployment practices
Feedback on architecture, scope, implementation strategy, and registry expectations would be greatly appreciated.
Summary
I would like to propose an MCP server implementation that uses CockroachDB as its primary state store to provide:
This proposal is intended as a standalone MCP server project that would later be published separately and referenced from the MCP Registry through a standard
server.yamlentry.Problem Statement
Many MCP server implementations rely on:
Under concurrent workloads or process restarts, these patterns can lead to:
As MCP adoption grows, there may be value in providing a reference architecture for stateful MCP servers that require stronger consistency guarantees.
Proposed Solution
Build a dedicated MCP server that uses CockroachDB as the system of record.
Durable State
All persistent state is stored in CockroachDB rather than local files or memory.
Idempotent Tool Execution
Each tool invocation is assigned an idempotency key.
The server records invocation state inside a transactional table before executing side effects.
This enables safe retries and prevents duplicate execution.
Serializable Transactions
Tool execution metadata is protected by CockroachDB's serializable transaction model, reducing race conditions and write conflicts.
Horizontal Scalability
Server instances remain stateless.
Multiple replicas can serve requests while sharing the same underlying CockroachDB cluster.
Architecture Overview
Core Components
Data Flow
Intended Deliverables
A separate public repository containing:
The MCP Registry submission would only contain the registry metadata entry pointing to the implementation repository and published image.
Benefits
Reliability
Consistency
Scalability
Operational Simplicity
Questions for Maintainers
Would a CockroachDB-backed MCP server be appropriate for inclusion in the MCP ecosystem?
Are there existing MCP servers that already address durable state and idempotent execution in a similar way?
Are there recommended patterns for documenting and registering stateful MCP servers within the registry?
Would maintainers prefer this as:
Are there any MCP Registry requirements that should influence repository structure, image publishing, or configuration design?
Additional Context
The goal is not to modify MCP Registry itself.
The goal is to provide a reusable MCP server implementation that demonstrates:
Feedback on architecture, scope, implementation strategy, and registry expectations would be greatly appreciated.