Building Blocks — MCP Server
BB — 05

MCP Server

Model Context Protocol is the standard that lets Claude connect to live external systems — databases, APIs, and services — at inference time, without that data ever needing to be baked into the model.

Read time12 min
LevelIntermediate
SectionBuilding Blocks
01 — the problem

Fragmentation

AI is everywhere, but it's trapped in silos.

The assistant inside Notion can't talk to the assistant inside Slack. Neither can talk to the AI in your code editor. Each one is smart inside its own box and blind to everything outside it.

The vision: one unified AI partner that understands your whole workflow — not work chopped up between a dozen disconnected agents.

AI in Notion (its own box) AI in Slack (its own box) AI in your IDE (its own box) ✕ ✕ No two assistants can share understanding
02 — the fuel

Context is everything

An AI is only as good as the context you can give it.

Context is all the information — conversation history, documents, data — that a model uses to generate a response. In a normal chat, the context is just the messages so far. Simple.

Now picture an engineer building one feature. The context isn't in one place — it's scattered: the ticket lives in Jira, the code in GitHub, the schema in MySQL, the spec in Google Drive, and the clarifying questions in Slack.

Developer + AI assistant Tool Tool Tool Tool Tool Jira GitHub MySQL Slack Drive
The developer's context lives in five different places at once.
03 — the pain

Copy-paste hell

To get useful answers, you become a human courier.

You open the ticket, copy it. Open the repo, copy the relevant code. Query the database, copy the schema. Open the doc, copy the spec. Paste it all into the AI — and only then can you start asking questions.

Do that for every task, every day. It's slow, error-prone, and it doesn't scale. The model is capable; the plumbing is the bottleneck.

04 — first fix

The solution: function calling

OpenAI introduced function calling in mid-2023.

Function calling is a way for an LLM to call external functions. Instead of you fetching data, the model decides which function to invoke and with what arguments — and your code runs it.

Read the content of the file abc.txt LLM name = abc.txt def load_file(name): ...
05 — it caught on

The rise of tools

Function calling became "tools," and tools let LLMs reach the outside world.

LLM Tool 1 Tool 2 Tool 3 Weather API Database GitHub

Every major AI app sprouted capabilities of its own:

Cursorfile-system access and intelligent code search
Perplexityweb browsing and real-time retrieval
ChatGPT Plusbrowsing, file uploads, code execution
Claudecomputer-use capabilities
06 — the catch

The problem with tools

Tools work — but they don't share.

Every AI app builds its own integration to every service. Want 3 agents to use 3 tools? That's a separate connector for each pair.

N × MN apps × M tools = a connector for every single combination. A development nightmare, because every connector reinvents different authentication methods, data formats, and error handling.

Chatbot Coding Agent Analytics Agent Jira Slack GitHub MySQL
3 × 4 = 12 separate integrations to build and maintain.
07 — the standard

Enter MCP

One protocol, spoken by everyone.

MCP flips N×M into N+M. An AI app becomes an MCP client; each service is wrapped once as an MCP server. Think of it like a USB-C port: you plug in a service — a database, a project management tool, a filesystem — and Claude gains live read/write access to it during a conversation.

Build to the protocol using the MCP Client SDK and MCP Server SDK and any client works with any server, automatically.

AI app Client MCP Client SDK Server Server Server MCP Server SDK → Drive → GitHub → DB
  • N clients + M servers = N + M integrations — not N × M.
  • No maintenance overhead — write a server once, every client benefits.
  • Reduced cost and time across the board.
08 — division of labour

The server does the heavy lifting

The client stays simple. The server absorbs the messy, service-specific work.

  • Authentication with the underlying service
  • API rate limiting
  • Data-format translation
  • Error handling
  • All the service-specific business logic
Server
09 — what's inside a server

Host, Client & the Three Primitives

The host is the AI app; it runs a client that connects to a server. MCP servers expose context through exactly three primitives. Understanding which to use and when is the key to building efficient servers.

Host Client GitHub Server tools resources prompts "Create an issue: the login button doesn't work."

Resources are static or dynamic data exposed as URI-addressable content — like files, database records, or API responses. Claude reads these to understand the current state of a system.

text
odoo://tickets/123       → returns ticket data as text/JSON
file://project/README.md → returns file contents

Tools are callable functions Claude invokes to fetch live data or perform actions. Each call returns structured results that join the AI's context window.

python
list_tickets()      → [{"id": 1, "name": "Bug: login fails", ...}, ...]
get_ticket(id=123)  → {"description": "...", "status": "open", ...}

Prompts are pre-written templates the server exposes. The AI or user invokes these to inject structured context, instructions, or workflows into the conversation — useful for repeatable analysis patterns.

10 — the whole picture

Putting it together

One host, multiple clients, multiple servers — local and remote — all speaking JSON-RPC 2.0.

A host can run several clients at once, one per server. Local servers connect over STDIO; remote servers over HTTP + SSE. The message format is the same either way.

Host Client Client LLM User Filesystem Server (local) tools resources prompts GitHub Server (remote) tools resources prompts JSON-RPC 2.0 via STDIO JSON-RPC 2.0 via HTTP + SSE
MCP sits on top of function calling — it standardises how the model's tool calls reach any server, anywhere.

MCP boundary is a token budget. Every byte the server returns costs context. Every unnecessary round-trip costs latency. Design both sides — server and caller — to minimise what crosses that boundary.

11 — why we built the odoo mcp

Problems Eliminated by the Odoo MCP

Before the Odoo MCP, our TiffinConnect development workflow had a set of recurring friction points. The MCP server was built to eliminate each one directly.

✗
Constant IDE switching
Developers had to leave VS Code and open Odoo in a browser to check ticket descriptions, statuses, or context. The MCP server connects Odoo directly into the Claude Code terminal.
✓
Board metrics on demand
PMs and leads no longer open Odoo to get metrics. They query Claude and receive analysis of the whole board — current stage distribution, blocked tickets, sprint health.
✗
Manual bulk ticket creation
Creating 50–70 sprint tickets from an SRS document used to take hours. The bulk_create_tickets tool creates all tickets with stages and assignee logic in minutes.
✓
Richer ticket descriptions, no typing cost
By attaching context files, Claude produces detailed descriptions automatically. The planning phase for each feature is faster and more thorough than any manual approach.

Additional problems solved: duplicate ticket detection, automatic subtask creation from ticket descriptions, context.md attachments for handovers when a developer goes on leave, and GitHub branch traceability via ticket numbers in commit/branch names.

12 — token efficiency patterns

How the Odoo MCP Stays Token-Efficient

Odoo's project.task model has 80+ fields. Every tool call in our MCP passes an explicit fields list — only the needed columns travel over the wire.

text
Identity fields (7)   → always returned
  id, name, stage_id, priority, user_ids, tag_ids, project_id

Detail fields (5)     → only when detail=True
  description, child_ids, date_deadline, create_date, write_date

Remaining ~70 fields  → never retrieved

Description truncation: Odoo stores descriptions as raw HTML. The server strips all tags, unescapes entities, and enforces hard character caps: 500 chars for get_ticket, 200 chars for create_ticket responses. A 5 KB HTML description becomes a ~300-character plain string.

TTL cache: An in-memory store with per-data-type TTLs prevents repeat reads from hitting Odoo at all. Single ticket reads and filtered list results cache for 60 seconds. User directories cache for 5 minutes. Project/stage/tag metadata caches for 10 minutes.

Pagination cap: list_tickets enforces a maximum of 50 records per call and returns a has_more flag. Claude fetches the next page only if the task actually requires it — a 200-ticket project does not dump everything into context at once.

13 — references

Further Reading

ResourceURL
Model Context Protocol — Official Documentationmodelcontextprotocol.io
Introducing MCP — Anthropic Bloganthropic.com
MCP Servers Registry — Pre-built servers for common toolsgithub.com/modelcontextprotocol/servers
PulseMCP — Odoo Assistant MCP Server listingpulsemcp.com
Check your understanding
1. What are the three primitives through which an MCP server provides context to AI applications?
Correct.Not quite — the correct answer is highlighted above.
2. In the Odoo MCP server, why are hard character caps applied to ticket descriptions before they reach Claude?
Correct.Not quite — the correct answer is highlighted above.
3. What problem does the bulk_create_tickets MCP tool directly solve in the TiffinConnect workflow?
Correct.Not quite — the correct answer is highlighted above.