Skip to main content
Glama
NumericalPie

knowledge-mcp-server

by NumericalPie
README.md
# knowledge-mcp-server

Small, forkable RAG project with an MCP server (for VS Code/Copilot) and a minimal web UI.

## Quick Start

Prerequisite: install `uv` from https://docs.astral.sh/uv/

```bash
uv sync
source .venv/bin/activate
```

Run tests:

```bash
uv run pytest
```

## Use It With Your Own Knowledge Set

1. Start from a clean data state (optional but recommended):

```bash
rm -f data/docs/* data/vectorstore/*
echo '{}' > data/metadata.json
```

2. Index content:

```bash
uv run python -m knowledge_mcp_server.cli index --url https://example.com
# or --pdf /path/to/file.pdf
# or --tex /path/to/file.tex
```

3. Query via MCP or HTTP/web UI.

## Register MCP Server In VS Code

```bash
code --add-mcp '{"name":"knowledge-mcp-server","command":"uv","args":["run","python","-m","knowledge_mcp_server.mcp_stdio_server"],"cwd":"'$(pwd)'"}'
```

## Run Web UI

```bash
uv run uvicorn knowledge_mcp_server.mcp_server:app --reload --port 8000
```

Open `http://127.0.0.1:8000/`.

## Project Layout

- Code: `src/knowledge_mcp_server/`
- Tests: `tests/`
- Runtime data: `data/docs/`, `data/vectorstore/`, `data/metadata.json`

## Defaults

- Embeddings: `all-MiniLM-L6-v2`
- Chunking: 800 words, 100 overlap
- HTTP port: `8000`

## Docs

- `docs/MCP_SETUP.md` - MCP registration and troubleshooting
- `docs/ARCHITECTURE.md` - architecture notes

## License

MIT (see `LICENSE`)

TDQS

A3.8/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: adding documents, indexing URLs, listing documents, and querying. No overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (add_document, index_url, list_documents, query_knowledge).

Tool Count5/5

With 4 tools, the server is appropriately scoped for a knowledge base manager, covering essential operations without excess.

Completeness4/5

The toolset covers adding (two methods), listing, and searching the knowledge base, but lacks update or delete operations, which is a minor gap.

Maintenance

ActivityInactive
ResponsivenessNo issues