Skip to content

timescale/tiger-docs-mcp-server

Repository files navigation

Tiger Docs MCP Server

A wrapper around our slack-db database, which contains embedded PostgreSQL documentation. This provides some focused tools to LLMs via the Model Context Protocol.

See slack-db for details on how the database is populated.

API

All methods are exposed as MCP tools and REST API endpoints.

Postgres Docs Semantic Search

Searches the PostgreSQL documentation for relevant entries based on a semantic embedding of the search prompt.

Tool name : semanticSearchPostgresDocs

API endpoint : GET /api/semantic-search/postgres-docs

Input

(use query parameters for REST API)

{
  "prompt": "What is the SQL command to create a table?",
  "version": 17, // optional, default is 17
  "limit": 10, // optional, default is 10
}

Output

{
  "results": [
    {
      "id": 11716,
      "headerPath": ["The SQL Language", "Creating a New Table"],
      "content": "CREATE TABLE ...",
      "tokenCount": 595,
      "distance": 0.40739564321624144,
    },
    // more results...
  ],
}

(the REST API returns a JSON array, just the content of the results field above)

Development

Cloning and running the server locally.

git clone --recurse-submodules [email protected]:timescale/tiger-docs-mcp-server.git

Submodules

This project uses git submodules to include the mcp boilerplate code. If you cloned the repo without the --recurse-submodules flag, run the following command to initialize and update the submodules:

git submodule update --init --recursive

You may also need to run this command if you pull changes that update a submodule. You can simplify this process by changing you git configuration to automatically update submodules when you pull:

git config --global submodule.recurse true

Building

Run npm i to install dependencies and build the project. Use npm run watch to rebuild on changes.

Create a .env file based on the .env.sample file.

cp .env.sample .env

Testing

The MCP Inspector is very handy.

npm run inspector
Field Value
Transport Type STDIO
Command node
Arguments dist/index.js

Testing in Claude Desktop

Create/edit the file ~/Library/Application Support/Claude/claude_desktop_config.json to add an entry like the following, making sure to use the absolute path to your local tiger-docs-mcp-server project, and real database credentials.

{
  "mcpServers": {
    "tiger-docs": {
      "command": "node",
      "args": [
        "/absolute/path/to/tiger-docs-mcp-server/dist/index.js",
        "stdio"
      ],
      "env": {
        "PGHOST": "x.y.tsdb.cloud.timescale.com",
        "PGDATABASE": "tsdb",
        "PGPORT": "32467",
        "PGUSER": "readonly_mcp_user",
        "PGPASSWORD": "abc123",
        "OPENAI_API_KEY": "sk-svcacct"
      }
    }
  }
}

Deployment

See here for our deployment setup.

About

MCP server to expose an API around our embedded docs database

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors 5