CouchDB MCP Server
CouchDB MCP Server is an open-source Python Model Context Protocol server for Apache CouchDB.
The project is in early development. Version 0.1.0 Read-Only Preview is implemented in source but has not been published as a release package yet. Published packages and release installation commands should not be assumed to exist until they are documented in a release.
0.1 Scope
Version 0.1.0 Read-Only Preview is a local, strictly read-only MCP server for Apache CouchDB 3.x.
The approved version 0.1 constraints are:
- local
stdioMCP transport only; - one CouchDB instance per server process;
- no writes, administration, replication, attachments, dashboard, embedded AI, or remote MCP server;
- compact, bounded, structured, model-friendly responses;
- security controls enforced by implementation, not only documentation.
See docs/SCOPE_0_1.md for the contributor-facing scope summary.
0.1 Tools
Version 0.1 exposes exactly these nine product tools:
get_server_statuslist_databasesget_database_infoget_documentlist_documentsquery_documentslist_indexesexplain_queryinspect_database_structure
The query_documents implementation supports a safe Mango subset: selector, fields, limit, bookmark, sort, and use_index. It does not expose arbitrary Mango options.
The list_indexes implementation lists Mango index metadata for authorized databases. It does not create, delete, or modify indexes.
The explain_query implementation explains a controlled Mango query plan for an authorized database. It does not return matching documents or expose raw design documents.
The inspect_database_structure implementation infers probable field structure from a bounded document sample. It reports field paths, observed types, occurrence counts, and frequencies without returning example values.
All nine approved version 0.1 tools are implemented in source. Release readiness still depends on packaging, verification, and publication checks.
Not In 0.1
The following are explicitly outside the approved 0.1 scope:
- document creation, updates, deletion, or bulk writes;
- database creation or deletion;
- index creation or deletion;
- user, permission, cluster, compaction, replication, or CouchDB configuration administration;
- arbitrary CouchDB endpoint wrappers such as
execute_request,call_endpoint, orsend_http_request; - attachments, revision history browsing, MapReduce views, and continuous changes feeds;
- Streamable HTTP transport, public remote MCP hosting, OAuth, OIDC, SSO, or remote sessions;
- multiple CouchDB instances in one server process;
- dashboard, desktop UI, embedded language model, embeddings, semantic search, autonomous agents, and automatic index creation.
Ideas outside 0.1 should be discussed as future-version candidates rather than implemented directly.
Security Direction
The intended 0.1 security model includes:
- database allowlists applied before CouchDB database requests;
- CouchDB system databases hidden by default;
- TLS certificate verification enabled by default for HTTPS;
- no credentials in MCP responses, exceptions, logs, URLs, snapshots, or committed files;
- response-size, JSON-depth, document-count, timeout, and pagination limits;
- normalized errors without internal stack traces;
- stdout reserved for MCP
stdioprotocol traffic, with diagnostics sent to stderr.
Documentation
Current project references:
Local Development
The Python project skeleton is managed with uv.
Current local checks:
uv sync
uv run ruff format --check .
uv run ruff check .
uv run mypy src tests
uv run pytest
Optional CouchDB integration tests are disabled by default. They require a local CouchDB instance and create then delete a dedicated test database:
$env:COUCHDB_MCP_RUN_INTEGRATION = "1"
$env:COUCHDB_MCP_COUCHDB_URL = "url"
$env:COUCHDB_MCP_COUCHDB_USERNAME = "username"
$env:COUCHDB_MCP_COUCHDB_PASSWORD = "password"
$env:COUCHDB_MCP_INTEGRATION_DATABASE = "couchdb_mcp_tools_integration"
uv run pytest tests/test_couchdb_tools_integration.py
uv run pytest tests/test_mcp_stdio_integration.py
The executable module runs a local stdio MCP server and exposes the nine approved version 0.1 tools.
Compatibility
For version 0.1 public preview, compatibility has been verified with MCP Inspector and the official MCP Python SDK stdio client.
Broader MCP host compatibility remains pending and will be validated after the public preview release.
Configuration
Configuration is loaded from environment variables with the COUCHDB_MCP_ prefix and,
for local development, from an optional .env file.
See .env.example for the current configuration surface.
Configuration validates:
- CouchDB base URL without embedded credentials;
- optional username and password, with password treated as a secret;
- database allowlist parsing and validation;
- system database access disabled by default;
- positive limits for documents, schema inspection, response size, JSON depth, and timeout;
- maximum limits greater than or equal to default limits;
- TLS verification enabled by default.
Contributing
Contributions should stay within the approved 0.1 scope unless an explicit product decision changes that scope.
Before proposing a change, read CONTRIBUTING.md and docs/SCOPE_0_1.md.
License
This project is licensed under the Apache License 2.0. See LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file couchdb_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: couchdb_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20705957a4a6cbecd97c160b4587094f80bd944312e44146347c0226ad0b07e8
|
|
| MD5 |
a54df0e67386c17cc5854abcd96ed3cf
|
|
| BLAKE2b-256 |
2d2b12d792001ae88be561674d99ea13d1afb31e3c638b05d20b3f0900ab943b
|
File details
Details for the file couchdb_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: couchdb_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.29
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
053824ab307213fef1c95d32533797d170b6f1d9bef733a4b9ee78e9932dcf9d
|
|
| MD5 |
c1b8589246b63d8f25be6ff317ddd960
|
|
| BLAKE2b-256 |
94b2e246820e3b61f4793611a3b9aba11e590aabae7476370cfee42e78a9ea8c
|