CouchDB MCP Server
Provides tools for interacting with Apache CouchDB, enabling operations such as database management (create, list, delete), document manipulation (create, get, update, delete, list), and search using Mango queries and indexing.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CouchDB MCP Server Search for users with the email 'john@example.com' in the users database"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CouchDB MCP Server
A Model Context Protocol (MCP) server that provides tools for interacting with CouchDB databases. This server enables Claude Code and other MCP clients to perform database operations, document management, and search queries on CouchDB instances.
Features
Database Operations
List Databases: View all databases on the CouchDB server
Create Database: Create new databases
Delete Database: Remove databases
Document Operations
Create Document: Insert new documents with optional custom IDs
Get Document: Retrieve documents by ID
Update Document: Modify existing documents
Delete Document: Remove documents
List Documents: View all documents in a database with optional full content
Search & Indexing
Search Documents: Query documents using CouchDB Mango queries with pagination support
Create Index: Create indexes for better query performance
List Indexes: View all indexes in a database
Related MCP server: Cloudant MCP Server by CData
Requirements
Python 3.10 or higher
CouchDB server (local or remote)
Claude Code CLI
Installation
Clone or download this repository to your local machine.
Install dependencies using uv (recommended):
uv syncOr using pip:
pip install -e .CouchDB Setup
Make sure you have CouchDB installed and running. You can:
Install CouchDB locally:
macOS:
brew install couchdbUbuntu/Debian:
sudo apt-get install couchdbOr download from couchdb.apache.org
Use Docker:
docker run -d -p 5984:5984 --name couchdb \ -e COUCHDB_USER=admin \ -e COUCHDB_PASSWORD=password \ couchdb:latestAccess CouchDB:
Default URL:
http://localhost:5984Web UI (Fauxton):
http://localhost:5984/_utils
Adding to Claude Code
To use this MCP server with Claude Code, you need to add it to your Claude Code configuration file.
Configuration File Location
The Claude Code configuration file is located at:
macOS/Linux:
~/.config/claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Configuration Steps
Open or create the configuration file:
# macOS/Linux
mkdir -p ~/.config/claude
nano ~/.config/claude/claude_desktop_config.jsonAdd the CouchDB MCP server to the
mcpServerssection:
Using uv (recommended):
{
"mcpServers": {
"couchdb": {
"command": "uv",
"args": [
"run",
"--directory", "/path/to/couchdb_mcp",
"python", "couchdb_mcp_server.py"
],
"env": {
"COUCHDB_URL": "http://localhost:5984"
}
}
}
}Using python directly (requires manual dependency install):
{
"mcpServers": {
"couchdb": {
"command": "python",
"args": [
"/path/to/couchdb_mcp_server.py"
],
"env": {
"COUCHDB_URL": "http://localhost:5984"
}
}
}
}For authenticated CouchDB instances, include credentials in the URL:
{
"mcpServers": {
"couchdb": {
"command": "uv",
"args": [
"run",
"--directory", "/path/to/couchdb_mcp",
"python", "couchdb_mcp_server.py"
],
"env": {
"COUCHDB_URL": "http://admin:password@localhost:5984"
}
}
}
}For remote CouchDB servers:
{
"mcpServers": {
"couchdb": {
"command": "uv",
"args": [
"run",
"--directory", "/path/to/couchdb_mcp",
"python", "couchdb_mcp_server.py"
],
"env": {
"COUCHDB_URL": "https://username:password@your-server.com:5984"
}
}
}
}Save the configuration file and restart Claude Code.
Usage Examples
Once configured, you can use Claude Code to interact with your CouchDB instance. Here are some example requests:
Database Operations
Create a new database called "users"List all databasesDelete the database named "test_db"Document Operations
Create a document in the users database with data: {"name": "John Doe", "email": "john@example.com"}Get the document with ID "user123" from the users databaseUpdate document user123 in users database with new email addressList all documents in the users databaseSearch Operations
Search the users database for all documents where name equals "John Doe"Search for documents in the products database where price is greater than 100Tool Reference
couchdb_list_databases
Lists all databases on the CouchDB server.
Parameters: None
couchdb_create_database
Creates a new database.
Parameters:
name(string, required): Name of the database to create
couchdb_delete_database
Deletes a database.
Parameters:
name(string, required): Name of the database to delete
couchdb_create_document
Creates a new document in a database.
Parameters:
database(string, required): Name of the databasedocument(object, required): Document data as JSON objectdoc_id(string, optional): Document ID (auto-generated if not provided)
couchdb_get_document
Retrieves a document from a database.
Parameters:
database(string, required): Name of the databasedoc_id(string, required): Document ID
couchdb_update_document
Updates an existing document.
Parameters:
database(string, required): Name of the databasedoc_id(string, required): Document IDdocument(object, required): Updated document data (must include_rev)
couchdb_delete_document
Deletes a document from a database.
Parameters:
database(string, required): Name of the databasedoc_id(string, required): Document IDrev(string, required): Document revision (_rev)
couchdb_search_documents
Searches for documents using Mango queries.
Parameters:
database(string, required): Name of the databasequery(object, required): Mango query selector (e.g.,{"name": "John"})limit(integer, optional): Maximum number of documents to return (default: 25)skip(integer, optional): Number of documents to skip (default: 0)
couchdb_list_documents
Lists all documents in a database.
Parameters:
database(string, required): Name of the databaselimit(integer, optional): Maximum number of documents to returninclude_docs(boolean, optional): Include full document content (default: false)
couchdb_create_index
Creates an index to dramatically improve Mango query performance.
Parameters:
database(string, required): Name of the databasefields(array, required): Fields to index (e.g.,["type", "name"])index_name(string, optional): Name for the index
Note: While indexes are optional, they are highly recommended. Without indexes, CouchDB scans all documents which can be very slow on large databases.
couchdb_list_indexes
Lists all indexes in a database.
Parameters:
database(string, required): Name of the database
About Indexes and Mango Queries
CouchDB's Mango query system (couchdb_search_documents) does not require indexes, but they are strongly recommended for performance.
According to the CouchDB documentation:
Without an index, CouchDB falls back to scanning all documents (
_all_docs)This works but "can be arbitrarily slow" on large databases
Creating indexes dramatically improves query performance
When to create indexes:
Your database has many documents (>1000)
Queries are slow
You frequently query the same fields
When you can skip indexes:
Small databases (<100 documents)
Infrequent queries
You don't mind slower response times
Example:
1. Try searching: "Search omnibot database where type equals 'name'"
2. If it works but is slow, create an index: "Create an index on the 'type' field in omnibot database"
3. Future queries will be much fasterTroubleshooting
Connection Issues
If you see connection errors:
Verify CouchDB is running:
curl http://localhost:5984Check the URL in your configuration
Verify credentials if using authentication
Check firewall settings for remote connections
Permission Errors
If you see permission errors:
Ensure the user has appropriate CouchDB permissions
Check that the database exists before performing document operations
Verify document revisions (
_rev) when updating or deleting
Search Returns No Results
If you're searching for documents but getting no results:
Verify documents exist: Use
couchdb_list_documentswithinclude_docs: trueto see actual document structureCheck field names match exactly: Field names are case-sensitive (
"Type"≠"type")Verify field values match: Values are also case-sensitive (
"Name"≠"name")Check the field exists: Queries only match documents where the field is present
Consider creating an index: While not required, indexes ensure queries work reliably and quickly
Tool Not Found
If Claude Code doesn't recognize the CouchDB tools:
Verify the configuration file path is correct
Ensure the
--directorypath (uv) or Python script path is absolute, not relativeRestart Claude Code after configuration changes
Check that dependencies are installed (
uv syncorpip install -e .)
Mango Query Examples
Mango queries use MongoDB-style selectors:
Equality:
{"name": "John Doe"}Comparison:
{"age": {"$gt": 18}}Multiple conditions:
{"$and": [{"age": {"$gte": 18}}, {"status": "active"}]}Pattern matching:
{"email": {"$regex": ".*@example\\.com$"}}License
MIT License
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Available Tools
11 toolscouchdb_create_databaseC
Create a new database
Inputs: name (required).
couchdb_create_documentC
Create a new document in a database
Inputs: database (required), document (required), doc_id.
couchdb_create_indexA
Create an index to improve Mango query performance. While optional, indexes dramatically speed up queries and ensure reliable results.
Inputs: database (required), fields (required), index_name.
couchdb_delete_databaseC
Delete a database
Inputs: name (required).
couchdb_delete_documentC
Delete a document from a database
Inputs: database (required), doc_id (required), rev (required).
couchdb_get_documentC
Retrieve a document from a database
Inputs: database (required), doc_id (required).
couchdb_list_databasesB
List all databases in the CouchDB server
Inputs: no named parameters.
couchdb_list_documentsC
List all documents in a database with their IDs and revisions
Inputs: database (required), limit, include_docs.
couchdb_list_indexesC
List all indexes in a database
Inputs: database (required).
couchdb_search_documentsA
Search for documents in a database using a Mango query. Works without indexes but creating indexes (via couchdb_create_index) improves performance significantly.
Inputs: database (required), query (required), limit, skip.
couchdb_update_documentC
Update an existing document in a database
Inputs: database (required), doc_id (required), document (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Every tool has a clearly distinct purpose targeting specific resources and actions in the CouchDB domain. The tools are well-differentiated by their object types (database, document, index) and operations (create, delete, get, list, search, update), with no ambiguous overlaps that would cause misselection.
All tools follow a perfectly consistent naming pattern: 'couchdb_' prefix followed by a verb (create, delete, get, list, search, update) and a noun (database, document, index). This uniform snake_case convention makes the tool set predictable and easy to navigate.
With 11 tools, this server is well-scoped for CouchDB operations, covering core database and document management. Each tool earns its place by addressing a specific, necessary function without redundancy, making the count appropriate for the domain.
The tool set provides complete CRUD/lifecycle coverage for databases, documents, and indexes, including creation, retrieval, updating, deletion, listing, and searching. There are no obvious gaps or dead ends, enabling agents to handle all essential CouchDB workflows effectively.
Maintenance
Related MCP Connectors
Shared memory and mail for your AI agents. Verified with Claude Code; other MCP clients in testing.
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceThis read-only MCP Server allows you to connect to Apache CouchDB data from Claude Desktop through CData JDBC Drivers. For full CRUD support, check out our MCP Server for Apache CouchDB (https://www.cdata.com/drivers/couchdb/download/mcp).MIT
- AlicenseNot gradedqualityDmaintenanceThis read-only MCP Server allows you to connect to Cloudant data from Claude Desktop through CData JDBC Drivers. Free (beta) read/write servers available at https://www.cdata.com/solutions/mcpMIT
- AlicenseBqualityBmaintenanceEnables MCP-compatible applications to directly interact with PocketBase databases for collection management, record operations, schema generation, and data analysis.2252 npm2MIT
- AlicenseNot gradedqualityDmaintenanceExposes sqlite3 database functionality as MCP tools, enabling SQL query execution, schema management, and CRUD operations.36 PyPI1MIT