home / mcp / coder db mcp server

Coder DB MCP Server

Provides a multi-database MCP server with memory, algorithm, and knowledge graph capabilities for code-related tasks.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "angrysky56-coder_db": {
      "command": "poetry",
      "args": [
        "run",
        "uvicorn",
        "mcp_server.main:app",
        "--reload",
        "--host",
        "0.0.0.0",
        "--port",
        "8000"
      ],
      "env": {
        "QDRANT_HOST": "localhost",
        "QDRANT_PORT": "6334",
        "QDRANT_API_KEY": "<QDRANT_API_KEY>",
        "SQLITE_DATABASE_URL": "sqlite+aiosqlite:///./mcp_server.db"
      }
    }
  }
}

You can run and use an MCP server that provides a standardized interface for AI models to interact with a structured memory system built on Qdrant, SQLite, and Neo4j. This server gives you memory storage and retrieval, algorithm management, and a knowledge graph to connect concepts, memories, and patterns, all accessible via a consistent API client.

How to use

You interact with the MCP server through a client that calls memory, algorithm, and knowledge graph endpoints. Use the memory endpoints to store and search code patterns, solutions, and documentation fragments. Use the algorithm endpoints to store and retrieve algorithm implementations and their versions. Use the knowledge graph endpoints to create concepts, link memories to concepts, and query related concepts. Start from a running server and use the provided endpoints to manage memories, algorithms, and graph relationships in a cohesive, queryable system.

How to install

Prerequisites: ensure you have a compatible Python environment and a package manager capable of handling project dependencies. You will also need a working environment where you can run a FastAPI server with Uvicorn.

# Install Poetry for dependency management (if not already installed)
# Follow the guidance from the Poetry project to install it on your system.

# In your project directory, install dependencies (dev included for tests)
poetry install --with dev

# Configure environment (optional but recommended)
# Create a .env file in the same directory where you run the server
# Example content:
# QDRANT_HOST="localhost"
# QDRANT_PORT=6334
# QDRANT_API_KEY=""
# SQLITE_DATABASE_URL="sqlite+aiosqlite:///./mcp_server.db"
# SQLITE_ECHO_LOG=True

# Start the development server
poetry shell
poetry run uvicorn mcp_server.main:app --reload --host 0.0.0.0 --port 8000

# The server will be available at http://127.0.0.1:8000
# Interactive API documentation: http://127.0.0.1:8000/docs
# Redoc documentation: http://127.0.0.1:8000/redoc

Configuration and usage notes

The server uses a multi-database setup with Qdrant for vector storage, SQLite for structured data, and Neo4j for the knowledge graph. Environment overrides can be provided through a .env file to customize connections to Qdrant and SQLite. The following points summarize essential behavior and setup considerations for running and using the MCP server.

Embedding and collection handling: memories are embedded and stored in Qdrant collections. The system can create collections on demand, apply a default embedding model, and respect collection-specific models when provided. Dynamic embedding ensures that the correct model and vector size are used for each collection.

Knowledge graph integration: on startup, the server connects to a Neo4j instance and initializes a basic schema for concepts, memories, and algorithms. It automatically updates the graph when new memories are stored, linking them to related concepts and tags.

Security and reliability: enable access controls, back up Qdrant and SQLite data, sanitize code examples, and maintain a change-log for memory and algorithm records. Regularly verify collection metadata and graph relationships to keep the system consistent.

API endpoints (overview)

System endpoints provide basic server information and health status.

Memory management endpoints enable storing and querying memory items such as code patterns and documentation snippets.

Algorithm management endpoints allow storing and searching algorithms along with their versions and performance context.

Knowledge graph endpoints support creating concepts, linking memories to concepts, and retrieving related concepts for a memory item.

Notes on usage patterns

When storing a memory, provide a clear type, language, and descriptive explanation to enrich search and graph associations.

When querying, combine semantic memory search with algorithm and graph queries to explore multiple angles for problem solving.

Troubleshooting and tips

If the server fails to start, verify that Python dependencies are installed, the .env file has correct values for Qdrant and SQLite, and that the Neo4j driver is available if you plan to use the knowledge graph.

Check that Qdrant collections exist or can be created by the server, and ensure the database files and sockets are accessible by the application.

Available tools

store_memory

Stores a new memory item into Qdrant with metadata such as type, language, and explanation.

find_memory

Searches memory items in Qdrant using a natural language query and optional filters like language, tags, and complexity.

store_algorithm

Stores a new algorithm or a new version in SQLite, including metadata such as category and performance metrics.

find_algorithm

Finds algorithms in SQLite by name or category and returns matching results.

kg_concept

Creates or merges a KGConcept node in Neo4j with a given name, type, and description.

kg_link_memory_to_concept

Links a Memory item to a KGConcept, creating nodes if necessary and establishing the relationship.

kg_memory_related_concepts

Fetches concepts directly related to a given KGMemory through defined relationships.