Skip to content

Build a Custom Model Context Protocol (MCP) Server for Internal APIs

Expose your internal databases, ERPs, ticketing tools, or SaaS product APIs cleanly to Claude, Czat.pro, and coding agents via open MCP.

The button copies the prompt and opens Michał Jaskólski’s LinkedIn profile: paste it into your message to him.

Why naive REST-to-MCP auto-generators fail in practice

  1. 01

    Design intent-level tools, never 1:1 raw REST endpoints

    Auto-generating 90 granular CRUD endpoints overwhelms tool selection; craft 8 high-level workflow tools like `lookup_customer_account_summary`.

  2. 02

    Return compact, LLM-legible payloads instead of 50KB JSON

    Strip internal UUID noise, paginate lists cleanly, and return actionable error hints so agents self-correct bad filter parameters.

  3. 03

    Enforce per-user OAuth identity, never one god-mode API key

    Pass the authenticated human's identity token end-to-end via remote HTTP/SSE MCP so existing row-level permissions always apply.

  4. 04

    Annotate mutating tools for explicit human confirmation

    Separate safe read-only queries from state-changing writes so workspaces always pause for human approval before sending or updating records.

How it works in practice

Naive auto-generated MCP wrapper

Exposed 64 raw OpenAPI endpoints directly -> LLM calls 6 wrong endpoints sequentially, receives 80KB raw JSON dump, and hits context window limits.

Curated workflow MCP server

9 task-oriented MCP tools with OAuth 2.1 scoping + compact Markdown/JSON summaries (<1.5KB per call) -> resolves complex account triage in 1 tool call (1.4s).

Great MCP servers are UX layers designed for model ergonomics, not mechanical OpenAPI schema dumps.

Frequently Asked Questions

Should we build a local stdio MCP server or a remote HTTP/OAuth MCP server?

Remote HTTP/OAuth MCP servers are far better for B2B teams and SaaS products—zero local Node/Python install headaches and centralized security updates.

Which AI clients work out of the box once we ship a standard MCP server?

Czat.pro, Claude Desktop/Web, Cursor, Claude Code, VS Code, Windsurf, and OpenAI's MCP-compatible agent runtimes all speak the same protocol.

How long does building and security-hardening a focused production MCP server take?

Most focused 6-to-12-tool remote MCP servers with OAuth 2.1 authentication and golden evaluation tests ship in two to three weeks.