loading…
Search for a command to run...
loading…
Provides tools for interacting with CouchDB databases, enabling document management, Mango search queries, and database administration. It allows Claude Code an
Provides tools for interacting with CouchDB databases, enabling document management, Mango search queries, and database administration. It allows Claude Code and other MCP clients to perform CRUD operations and manage indexes on local or remote CouchDB instances.
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.
Clone or download this repository to your local machine.
Install dependencies using uv (recommended):
uv sync
Or using pip:
pip install -e .
Make sure you have CouchDB installed and running. You can:
Install CouchDB locally:
brew install couchdbsudo apt-get install couchdbUse Docker:
docker run -d -p 5984:5984 --name couchdb \
-e COUCHDB_USER=admin \
-e COUCHDB_PASSWORD=password \
couchdb:latest
Access CouchDB:
http://localhost:5984http://localhost:5984/_utilsTo use this MCP server with Claude Code, you need to add it to your Claude Code configuration file.
The Claude Code configuration file is located at:
~/.config/claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json# macOS/Linux
mkdir -p ~/.config/claude
nano ~/.config/claude/claude_desktop_config.json
mcpServers section: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"
}
}
}
}
{
"mcpServers": {
"couchdb": {
"command": "uv",
"args": [
"run",
"--directory", "/path/to/couchdb_mcp",
"python", "couchdb_mcp_server.py"
],
"env": {
"COUCHDB_URL": "http://admin:password@localhost:5984"
}
}
}
}
{
"mcpServers": {
"couchdb": {
"command": "uv",
"args": [
"run",
"--directory", "/path/to/couchdb_mcp",
"python", "couchdb_mcp_server.py"
],
"env": {
"COUCHDB_URL": "https://username:[email protected]:5984"
}
}
}
}
Once configured, you can use Claude Code to interact with your CouchDB instance. Here are some example requests:
Create a new database called "users"
List all databases
Delete the database named "test_db"
Create a document in the users database with data: {"name": "John Doe", "email": "[email protected]"}
Get the document with ID "user123" from the users database
Update document user123 in users database with new email address
List all documents in the users database
Search the users database for all documents where name equals "John Doe"
Search for documents in the products database where price is greater than 100
Lists all databases on the CouchDB server.
Parameters: None
Creates a new database.
Parameters:
name (string, required): Name of the database to createDeletes a database.
Parameters:
name (string, required): Name of the database to deleteCreates 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)Retrieves a document from a database.
Parameters:
database (string, required): Name of the databasedoc_id (string, required): Document IDUpdates an existing document.
Parameters:
database (string, required): Name of the databasedoc_id (string, required): Document IDdocument (object, required): Updated document data (must include _rev)Deletes a document from a database.
Parameters:
database (string, required): Name of the databasedoc_id (string, required): Document IDrev (string, required): Document revision (_rev)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)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)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 indexNote: While indexes are optional, they are highly recommended. Without indexes, CouchDB scans all documents which can be very slow on large databases.
Lists all indexes in a database.
Parameters:
database (string, required): Name of the databaseCouchDB's Mango query system (couchdb_search_documents) does not require indexes, but they are strongly recommended for performance.
According to the CouchDB documentation:
_all_docs)When to create indexes:
When you can skip indexes:
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 faster
If you see connection errors:
curl http://localhost:5984If you see permission errors:
_rev) when updating or deletingIf you're searching for documents but getting no results:
couchdb_list_documents with include_docs: true to see actual document structure"Type" ≠ "type")"Name" ≠ "name")If Claude Code doesn't recognize the CouchDB tools:
--directory path (uv) or Python script path is absolute, not relativeuv sync or pip install -e .)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$"}}
MIT License
Contributions are welcome! Please feel free to submit issues or pull requests.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"couchdb-mcp-server": {
"command": "npx",
"args": []
}
}
}