Start a project

MCP Server

2025 · AI agents · MCP

Your files,their AI,no keys shared.

A research assistant server for the Model Context Protocol: any AI app that speaks MCP can list a team's documents and summarize them.

The server holds no AI key. When it needs a summary it asks the connected AI to write it, and every team's files stay behind their own wall.

Year
2025
Role
Design, build
Stack
Python · FastMCP · Pydantic
Source
GitHub
01 · The run

One command, and it is listening.

A real start, recorded in the terminal. The server loads its logging, registers its tools and waits for an AI app to connect over standard input and output.

  • Framework3.0.2FastMCP
  • Transportstdiolocal
  • Tools2registered
02 · The conversation

Watch the AI and the server talk.

A server and an AI exchange a long document and a short summary along two paths of light
Sampling · the document goes out, the summary comes back
  1. Connect

    The AI app says hello.

    Any MCP client can connect: a desktop assistant, an IDE, an agent. The server introduces itself as ResearchAssistantServer.

  2. Discover

    “What can you do?”

    The server answers with its tools, each with a name, a description and typed inputs, so the AI knows exactly how to call them.

  3. Call

    “Summarize the Q3 report.”

    The AI picks summarize_document and fills in the team and the file name. A name is enough: the server finds the file itself.

  4. Check

    Checks before reading.

    The file is found, then checked against the team's wall before a single byte is read. Each step is reported back to the AI as a log line.

  5. Sampling

    The arrow turns around.

    Now the server asks the AI to write the summary. This is MCP sampling: the server borrows the client's model, so it never needs an API key of its own.

  6. Result

    Back with a summary.

    The AI writes it, the server checks that what came back is really text, reports 100% and returns the file name with its summary.

03 · Tools

Two tools, typed and described.

A tool is a plain Python function. FastMCP reads its signature and turns it into a schema the AI can follow, so a wrong argument is caught before the function runs.

  1. tool

    list_research_documents

    Lists the research files and folders in a team's own folder.

    tenant_id
    str · required
    relative_path
    str = "."
    recursive
    bool = true
    include_hidden
    bool = false
    allowed_file_types
    .md .txt .pdf .csv .json .docx .pptx .xlsx
    Returnsfiles · sizes · folders
  2. tool

    summarize_document

    Finds a document by name, reads it and has the connected AI summarize it.

    tenant_id
    str · required
    filename
    str · with or without extension
    ctx
    logs · progress · sampling
    Returnsfilename · summary
04 · The wall

Try to get out.

Every path goes through one check. It rejects absolute and parent paths outright, then resolves the rest, links included, and refuses anything that lands outside the team's folder.

Two glass rooms of documents with a wall of light between them; a document trying to cross is stopped
Allowedtenant_alpha_docs/reports/q3-report.md

Resolves inside the team's folder.

05 · Tests

Every way in, tested.

16Tests
5Aimed at the wall
2Tools
2Teams, kept apart
  • Wall · traversal

    Climbing out with “..”

    A path that starts by stepping up a folder is refused before it is ever resolved.

  • Wall · absolute

    Jumping straight to /etc/passwd.

    Absolute paths are refused, even ones that point inside the server's own data.

  • Wall · neighbours

    Reading another team's folder.

    A path built to reach tenant_beta from tenant_alpha is refused.

  • Wall · links

    A link that points outside.

    Links are followed first, then judged by where they really land.

  • Listing · 11 tests

    Folders, filters and edge cases.

    Recursive and flat listings, hidden files, empty folders, missing paths, a file passed as a folder, and file-type filters.

Built in Python 3.12 with FastMCP and Pydantic, with structured logging, typed errors and tests on every tool.

A learning project · built with production patterns, not running in production yet

More projects

All work