Skip to main content
Glama
NumericalPie

knowledge-mcp-server

by NumericalPie

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/

uv sync
source .venv/bin/activate

Run tests:

uv run pytest

Related MCP server: pdf-knowledge-mcp

Use It With Your Own Knowledge Set

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

rm -f data/docs/* data/vectorstore/*
echo '{}' > data/metadata.json
  1. Index content:

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
  1. Query via MCP or HTTP/web UI.

Register MCP Server In VS Code

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

Run Web UI

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)

Available Tools

4 tools
add_documentB

Add a markdown document to the knowledge base

ParametersJSON Schema
NameRequiredDescriptionDefault
markdownYesThe markdown content to add
titleNoOptional title for the document
repoNoOptional repository name

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. Description does not disclose behavioral traits such as duplicate handling, authorization requirements, or side effects. For a mutation tool, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence that is direct and free of extraneous information. Perfectly concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple nature of the tool (3 params, no output schema) and presence of sibling tools, the description is minimally adequate but lacks details about behavior (e.g., what happens on success/error, document ID returned).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema describes all three parameters (markdown, title, repo) with 100% coverage. Description adds no additional meaning beyond the schema, so baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the action (add) and resource (markdown document to the knowledge base). It differentiates from sibling tools like index_url (adds URL) and list_documents (lists documents).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. No mention of prerequisites or scenarios where this tool should be avoided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

index_urlB

Fetch and index content from a URL into the knowledge base

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to index

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It only states the action (fetch and index) but does not mention potential side effects like rate limiting, authentication requirements, or error handling for unreachable URLs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no unnecessary words. It is appropriately concise for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one parameter and no output schema, the description is adequate but lacks completeness in terms of usage context, error conditions, and expectations. It is a minimal viable description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% (one parameter with description). The description does not add meaning beyond the schema's parameter description. Baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (fetch and index), the resource (content from a URL), and the destination (knowledge base). It distinguishes from siblings: add_document adds documents directly, list_documents lists, query_knowledge queries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus siblings like add_document or query_knowledge. There is no mention of prerequisites, exclusions, or alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_documentsA

List all documents in the knowledge base

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It states 'list all documents' implying a read operation with no side effects, but does not disclose any potential issues like large result sets, pagination, or ordering. It is adequate but lacks extra behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no wasted words. Front-loads the purpose. Perfect conciseness for a simple tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters, no output schema, and no annotations, the description is minimalistic. It covers the basic operation but does not specify if it returns full document content or only metadata. Adequate but could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so schema coverage is 100%. The description does not need to add param info. Baseline 4 for zero params is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the verb 'list' and resource 'documents', distinguishing it from sibling tools like add_document (create) and query_knowledge (search). It specifies the scope 'in the knowledge base', making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives. While siblings exist, the description does not provide any context about when listing all documents is appropriate or when to use other tools like query_knowledge for filtered results.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

query_knowledgeA

Search the knowledge base using semantic search. Returns relevant document chunks with similarity scores.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query
top_kNoNumber of results to return

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses the return format (document chunks with similarity scores) but does not mention any behavioral aspects such as authentication requirements, rate limits, or side effects. The description is adequate but not rich in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that covers both purpose and output with no superfluous words. It is highly efficient and front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple search tool with two parameters and clear sibling tools, the description is mostly complete. It includes what the tool does and what it returns (chunks with scores). However, it lacks explicit mention of scope (e.g., whether it searches all documents) and is slightly sparse given no output schema, but still sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers 100% of parameters, with clear descriptions for 'query' and 'top_k'. The description does not add any additional meaning beyond the schema, so it meets the baseline but does not exceed it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'search', the resource 'knowledge base', the method 'semantic search', and the output 'relevant document chunks with similarity scores'. It effectively distinguishes the tool from siblings (add_document, index_url, list_documents) which perform different operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for searching the knowledge base but does not explicitly state when this tool should be used versus alternatives, nor does it provide any when-not-to-use guidance. Given the sibling tools, the usage context is clear but not elaborated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedadd_document
    • First observedindex_url
    • First observedlist_documents
    • First observedquery_knowledge

TDQS

A3.8/5.0
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

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NumericalPie/knowledge-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server