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.
All methods are exposed as MCP tools and REST API endpoints.
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
(use query parameters for REST API)
{
"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)
Cloning and running the server locally.
git clone --recurse-submodules [email protected]:timescale/tiger-docs-mcp-server.git
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
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
The MCP Inspector is very handy.
npm run inspector
Field | Value |
---|---|
Transport Type | STDIO |
Command | node |
Arguments | dist/index.js |
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"
}
}
}
}
See here for our deployment setup.