- Drop the content alias from store_knowledge handler - Fix error message to say 'note' only - Correct README store_knowledge params to match actual API - Fix EMBEDDING_BASE_URL default (no /v1 suffix)
118 lines
2.7 KiB
Markdown
118 lines
2.7 KiB
Markdown
# St-Pierre - Knowledge MCP Server
|
|
|
|
Remote MCP server that stores and retrieves knowledge using Qdrant vector
|
|
database and OpenAI embeddings.
|
|
|
|
## Tools
|
|
|
|
### `store_knowledge`
|
|
Store a piece of knowledge for later retrieval. Automatically generates
|
|
embeddings via OpenAI and persists them in Qdrant.
|
|
|
|
Parameters:
|
|
- `note` (string, required): The markdown body
|
|
- `repos` (array of string, optional): Repository names
|
|
- `host` (string, optional): Hostname or null if universal
|
|
- `tags` (array of string, optional): Tags
|
|
- `user` (string, optional): User identifier
|
|
- `context` (string, optional): What triggered this
|
|
|
|
### `search_knowledge`
|
|
Semantic search across stored knowledge.
|
|
|
|
Parameters:
|
|
- `query` (string, required): Search query
|
|
- `limit` (number, optional, default 5): Max results
|
|
|
|
## Setup
|
|
|
|
### Prerequisites
|
|
|
|
- Qdrant instance
|
|
- OpenAI API key
|
|
|
|
### Environment Variables
|
|
|
|
```env
|
|
QDRANT_URL=localhost # Required: Qdrant hostname
|
|
QDRANT_PORT=6334 # Optional: Qdrant gRPC port (default: 6334)
|
|
QDRANT_API_KEY= # Optional: Qdrant API key
|
|
QDRANT_TLS=false # Optional: Enable TLS
|
|
OPENAI_API_KEY=sk-... # Required: API key (OpenAI or DeepSeek)
|
|
EMBEDDING_BASE_URL=https://api.openai.com # Optional: base URL (OpenAI by default)
|
|
EMBEDDING_MODEL=text-embedding-3-small # Optional: embedding model
|
|
MCP_TOKEN=my-secret-token # Required: Bearer token for auth
|
|
PORT=8080 # Optional: HTTP port (default: 8080)
|
|
```
|
|
|
|
### Running
|
|
|
|
```bash
|
|
# Using OpenAI embeddings
|
|
export QDRANT_URL=localhost
|
|
export OPENAI_API_KEY=sk-...
|
|
export MCP_TOKEN=my-secret-token
|
|
./st-pierre
|
|
|
|
# Using DeepSeek embeddings
|
|
export OPENAI_API_KEY=sk-...
|
|
export EMBEDDING_BASE_URL=https://api.deepseek.com/v1
|
|
export EMBEDDING_MODEL=deepseek-chat
|
|
export MCP_TOKEN=my-secret-token
|
|
./st-pierre
|
|
```
|
|
|
|
### Nix
|
|
|
|
```bash
|
|
# Build and run directly
|
|
nix run github:didier/st-pierre -- --help
|
|
|
|
# Development shell
|
|
nix develop
|
|
```
|
|
|
|
### NixOS Module
|
|
|
|
```nix
|
|
# flake.nix
|
|
{
|
|
inputs.st-pierre.url = "github:didier/st-pierre";
|
|
...
|
|
}
|
|
|
|
# configuration.nix
|
|
{ inputs, ... }: {
|
|
imports = [ inputs.st-pierre.nixosModules.st-pierre ];
|
|
|
|
services.st-pierre = {
|
|
enable = true;
|
|
port = 8080;
|
|
qdrantUrl = "localhost";
|
|
openaiApiKeyFile = /run/secrets/openai-api-key;
|
|
tokenFile = /run/secrets/mcp-token;
|
|
};
|
|
}
|
|
```
|
|
|
|
The NixOS module creates a dedicated `st-pierre` system user and a systemd
|
|
service. Secrets (API keys, tokens) should be provided as files rather than
|
|
inline strings.
|
|
|
|
## MCP Client Configuration
|
|
|
|
Add to your MCP client config:
|
|
|
|
```json
|
|
{
|
|
"mcpServers": {
|
|
"knowledge": {
|
|
"url": "http://your-server:8080/mcp",
|
|
"headers": {
|
|
"Authorization": "Bearer my-secret-token"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
```
|