# TypeDB MCP Server

TypeDB MCP Server is an MCP (Model Context Protocol) server that enables AI assistant tools and autonomous agents to interact with TypeDB databases. It provides structured access to execute TypeQL queries, manage databases, and manage users, making TypeDB accessible to AI-powered development tools and agent frameworks.

## [](#_what_is_mcp)What is MCP?

The Model Context Protocol (MCP) is a standardized protocol that allows AI assistant tools and autonomous agents to interact with external tools and services. TypeDB MCP Server implements this protocol, enabling tools like Cursor IDE and autonomous agents to communicate with TypeDB databases seamlessly.

## [](#_when_to_use_typedb_mcp_server)When to use TypeDB MCP Server

TypeDB MCP Server is ideal when you want to:

*   Enable AI assistant tools and autonomous agents to query and manage TypeDB databases
    
*   Integrate TypeDB with AI-powered IDEs and development tools
    
*   Prototype and explore TypeDB schemas and data interactively with AI assistance
    
*   Automate database operations through agent frameworks
    

## [](#_features)Features

TypeDB MCP Server provides the following capabilities:

*   **Query Execution**: Run TypeQL read, write, and schema queries
    
*   **Database Management**: List, create, and delete databases
    
*   **User Management**: List, create, and delete users
    

## [](#_running_the_server)Running the Server

TypeDB MCP Server is distributed as a Docker image. To run the server:

```bash
docker run -p 8001:8001 typedb/typedb-mcp:<version> \
  --typedb-address <address> \
  --typedb-username <username> \
  --typedb-password <password>
```

Replace `<version>` with the desired version number, and provide your TypeDB server connection details.

### [](#_connecting_to_localhost)Connecting to localhost

If you’re running TypeDB server on localhost, there are special considerations:

*   Replace `<address>` with `[http://host.docker.internal:8000](http://host.docker.internal:8000)` instead of `[http://localhost:8000](http://localhost:8000)`
    
*   On Linux, add the `--add-host=host.docker.internal:host-gateway` flag to the Docker command
    

```bash
docker run -p 8001:8001 --add-host=host.docker.internal:host-gateway \
  typedb/typedb-mcp:<version> \
  --typedb-address http://host.docker.internal:8000 \
  --typedb-username <username> \
  --typedb-password <password>
```

## [](#_configuration)Configuration

TypeDB MCP Server accepts the following configuration parameters:

 

Parameter

Description

`--typedb-address`

The address of your TypeDB server (e.g., `[http://localhost:8000](http://localhost:8000)` or `[http://host.docker.internal:8000](http://host.docker.internal:8000)` when running in Docker)

`--typedb-username`

Username for authenticating with the TypeDB server

`--typedb-password`

Password for authenticating with the TypeDB server

The server listens on port `8001` by default. You can map this to a different host port using Docker’s `-p` flag.

## [](#_using_with_cursor_ide)Using with Cursor IDE

Cursor IDE is an AI-powered code editor that supports MCP servers. To integrate TypeDB MCP Server with Cursor:

1.  Start the MCP server (see above)
    
2.  Open Cursor Settings → MCP
    
3.  Create or edit `.cursor/mcp.json` in your project directory:
    
    ```json
    {
      "mcpServers": {
        "typedb": {
          "url": "http://localhost:8001/mcp"
        }
      }
    }
    ```
    
4.  Restart Cursor or refresh MCP connections
    
5.  Start chatting! You can now ask Cursor to interact with TypeDB:
    
    *   "List all databases"
        
    *   "Create a database called 'mydb'"
        
    *   "Define an entity 'person' with attribute 'name' in database 'mydb'"
        
    *   "Insert a person with name 'Alice'"
        
    *   "Query all persons in the database"
        
    

## [](#_additional_resources)Additional Resources

[GitHub Repository](https://github.com/typedb/typedb-mcp)

Browse the source code and contribute to TypeDB MCP Server.

[Docker Hub](https://hub.docker.com/r/typedb/typedb-mcp)

Download TypeDB MCP Server Docker images.

[TypeDB Admin Tool](../admin/index.md) [IDE Plugins](../ide-plugins/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/tools/modules/ROOT/pages/mcp-server.adoc) Edit this page on GitHub.