ot5-mcp-server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ot5-mcp-serverExtract text from sample.pdf"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP document recognition server
MCP server in TypeScript/Node.js for IDE agents (VSCode). Provides 4 tools: recognition of electronic PDF, Word (DOCX), Excel (XLSX), and PostgreSQL search. Each tool returns structured JSON to the agent.
Features
Tool | What it does | What it returns |
| Recognizes text-based (not scanned) PDFs | Metadata, page count, text page by page |
| Recognizes DOCX | Headings, paragraphs, tables, lists |
| Recognizes XLSX | Sheet, columns, row count, first rows |
| Searches PostgreSQL (read-only) | Tables, columns, rows (SELECT) |
The result contract for each tool: see docs/contract.md.
Related MCP server: Document Search MCP Server
MCP principles
The agent (IDE) connects to the MCP server over stdio transport: the IDE launches the server as a child process (in our case, a Docker container, see opencode.json) and exchanges JSON-RPC 2.0 messages with it. The connection lifecycle consists of three phases: initialize → tools/list → tools/call. During the tools/list phase, the agent receives tool descriptions (name, description, input parameter schema) and adds them to the model context; during the tools/call phase, the agent passes arguments to the server, the server does the actual work, and returns a structured JSON result, which goes back into the model context to form a response.
Tool is a function declared by the server: it has a name, a human-readable description, and a JSON parameter schema. The model does not execute anything itself — it only decides which tool to call and with what arguments; execution always happens on the MCP server side. In this project the tools are extract_pdf, extract_word, extract_excel, and postgres_search. A visual explanation with Mermaid diagrams is in docs/mcp-explained.html.
Requirements
Node.js 20.11+ (
import.meta.dirnameis used)PostgreSQL (only for the
postgres_searchtool)
Installation and startup
npm install # установка зависимостей
npm run build # сборка в dist/
npm run make-samples # сгенерировать образцы в samples/ (для проверки)
npm start # запуск сервера напрямую (stdio)Environment variables are in the .env file (copy .env.example, specify DATABASE_URL). The actual .env is not committed.
Running in Docker
The entire environment is run with containers: the MCP server (built from Dockerfile) and PostgreSQL with test data.
# 1. Собрать образ MCP-сервера
docker build -t ot5-mcp-server .
# 2. Поднять PostgreSQL с тестовыми данными (db/init.sql)
docker compose up -d db
# 3. Проверка (опционально): тулы через stdio-контейнер
docker run -i --rm --network ot5_default -e PROJECT_ROOT=/project \
-e DATABASE_URL=postgres://dev:dev@db:5432/docs \
-v "%CD%:/project" ot5-mcp-server:latestSchema: db lives in the ot5_default network; the VSCode MCP container connects to the same network and accesses the DB via the service name db. Postgres data is in the named volume pgdata.
Connecting to the agent in VSCode (opencode)
The project uses the opencode extension for VSCode (
sst-dev.opencode). opencode connects MCP servers through its ownopencode.jsonconfig (not through.vscode/mcp.json, which is needed only for the built-in GitHub Copilot MCP gateway).
Install dependencies and build the project:
npm install && npm run build.Bring up the environment in Docker:
docker compose up -d db docker build -t ot5-mcp-server .The project root already contains
opencode.json— it startsdocs-serveras a container:{ "$schema": "https://opencode.ai/config.json", "mcp": { "docs-server": { "type": "local", "command": [ "C:\\Program Files\\Docker\\Docker\\resources\\bin\\docker.exe", "run", "-i", "--rm", "--network", "ot5_default", "-e", "PROJECT_ROOT=/project", "-e", "DATABASE_URL=postgres://dev:dev@db:5432/docs", "-v", "C:\\Users\\User\\Documents\\HW\\OT-5:/project", "ot5-mcp-server:latest" ], "enabled": true } } }Docker must be running, the
ot5-mcp-server:latestimage must be built, and theot5_defaultnetwork must exist. The path todocker.exeis full because Docker is not in PATH.Restart opencode (close/reopen the VSCode window or restart the agent session) — the config is read at startup.
In the agent chat, send a request that explicitly names the tool, e.g. «Call the
extract_pdfMCP tool forsamples/sample.pdf».Call confirmation: the agent's response will come as JSON, and the server logs will appear in the terminal/Docker.
Secrets: the database connection string for docker mode is the local dev account
dev:dev, for tests only.
Verification without an IDE (smoke test)
npm run smoke-testThe script scripts/smoke-test.mjs starts the built server via stdio through the MCP client and calls all the tools.
The output of the last run: docs/evidence/smoke-test.log.
Example of a server-side log line (tool name, parameters, status):
{"ts":"2026-08-20T06:45:44.748Z","tool":"extract_pdf","params":{"path":"samples/sample.pdf"},"status":"success"}
{"ts":"2026-08-20T06:45:44.787Z","tool":"extract_word","params":{"path":"samples/sample.docx"},"status":"success"}
{"ts":"2026-08-20T06:45:44.798Z","tool":"extract_excel","params":{"path":"samples/sample.xlsx"},"status":"success"}
{"ts":"2026-08-20T06:45:44.811Z","tool":"postgres_search","params":{"operation":"list_tables"},"status":"success"}Logging is implemented in src/logger.ts:20–34 (it strips keys like password/token).
Security and limitations
File access — only relative paths within the project root; traversal via
../is prohibited (src/security.ts:6–22).PostgreSQL — read-only: session
BEGIN READ ONLY, onlySELECT, no multi-statements, request timeout 10 s (src/tools/postgres.ts:43–86). The connection string is taken only from.envand never enters the logs.Secrets — only
.env.exampleis in the repository; logging strips keys likepassword/token, etc. (src/logger.ts:19–34).PDF — only electronic (text) PDFs. Scanned documents (images) are not recognized — OCR is out of scope.
Code references (as required by the task)
Server and tool registration —
src/index.ts:35–106(tools) andsrc/index.ts:107–108(stdio transport).Tool implementations:
extract_pdf—src/tools/pdf.ts:14–33(implementation), logging insrc/index.ts:36–49;extract_word—src/tools/word.ts:17–71, logging insrc/index.ts:52–65;extract_excel—src/tools/excel.ts:15–36, logging insrc/index.ts:68–81;postgres_search—src/tools/postgres.ts:43–86, logging insrc/index.ts:84–104.
Call logging —
src/logger.ts:19–34; output example: docs/evidence/smoke-test.log.Result contract — docs/contract.md.
Verification prompts for the agent (criterion «calls from the IDE»)
The prompts were run in the opencode agent chat inside VSCode. Conversation transcript: mcp_ans.md (not committed; contains extracted content from personal documents). Summary table: docs/evidence/verification.md.
# | Prompt in VSCode | Expected tool | Fact (from the transcript) |
1 | «What MCPs are available to you» | — (configuration check) | The agent read |
2 | «Recognize all PDF files in the folder» |
| Called for |
3 | «Give a summary of the file Анализ…МЧС России.docx» |
| Document summary generated from the extracted text |
4 | «Show the list of tables in the DB» |
| Returned employees, orders, products |
5 | «Show the list of tables in the DB» (again) |
| Similar result |
6 | «Price summary from Перечень…xls» |
| A table with prices and manufacturing lead times was generated |
7 | «Review the document Приложение 0…pdf» |
| Correct error «file not found in the project» |
8 | «Read the file Приложение.pdf in C:\Users\User\Documents\» |
| Error: access only to the project folder via Docker volume; Read denied by the user |
Summary by the criterion: 8 verification prompts, of which 7 lead to MCP tool calls (the requirement of «at least 5 requests, at least 3 real calls» is met with a margin), and 2 negative prompts additionally confirm the security boundaries.
Project structure
src/index.ts # сервер, stdio-транспорт, регистрация тулов
src/logger.ts # логирование вызовов (имя, параметры, статус)
src/security.ts # проверка путей внутри корня проекта
src/tools/pdf.ts # PDF (pdf-parse)
src/tools/word.ts # DOCX (mammoth + cheerio)
src/tools/excel.ts # XLSX (xlsx / SheetJS)
src/tools/postgres.ts # PostgreSQL (pg, read-only)
scripts/make-samples.ts # генерация образцов
scripts/smoke-test.mjs # смоук-тест через MCP-клиент
Dockerfile # образ MCP-сервера
docker-compose.yml # PostgreSQL с тестовыми данными
db/init.sql # инициализация БД (таблицы + данные)
opencode.json # MCP-конфиг для агента opencode
docs/contract.md # контракт результатов
docs/evidence/ # логи подтверждений (smoke-test.log, verification.md)
docs/mcp-explained.html # наглядное объяснение принципов MCP (схемы Mermaid)This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that enables searching and reading binary document files (PDF, DOCX, PPTX, XLSX, ODT, ODS, ODP, RTF, EPUB) using regex patterns and retrieving content by sections.2MIT
- FlicenseNot gradedqualityBmaintenanceA local MCP server providing read-only access to documents like Word, PDF, Excel, and images, with file listing, reading, and metadata extraction.
- AlicenseNot gradedqualityBmaintenanceMCP server for comprehensive PDF processing including text extraction with OCR, keyword search with regex, table extraction, and page preview as Base64 PNG images.1MIT
- AlicenseNot gradedqualityDmaintenanceA read-only MCP server for PDF analysis that enables text extraction, image extraction, metadata retrieval, and text search via natural language.MIT
Related MCP Connectors
A paid remote MCP for Context7 MCP docs, built to return verdicts, receipts, usage logs, and audit-r
OCR, transcription, file extraction, and image generation for AI agents via MCP.
MCP server for the PDFGate API. Generate PDFs, manage documents and handle e-signatures.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Epyur/ot5-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server