Intermediate11 min
Building Custom MCP Servers for Internal Tools
When no existing MCP server covers your internal APIs, proprietary databases, or company-specific tools, you build your own. This article covers the minimal server structure, tool and resource handlers, and the April 2026 maxResultSizeChars feature that prevents silent truncation of large outputs.
Quick Reference
- →Build when: internal APIs, proprietary data sources, company-specific tools
- →SDKs: TypeScript (@modelcontextprotocol/sdk) and Python (mcp) — both official
- →Tool description is critical — Claude uses it to decide when to invoke the tool
- →v2.1.91: set _meta["anthropic/maxResultSizeChars"] up to 500K to prevent silent truncation
- →Add this to every custom tool that can return large outputs
- →Test locally with /mcp before deploying to production
- →Package as a plugin for easy team distribution
When to Build Your Own MCP Server
Existing MCP servers cover common platforms — GitHub, Postgres, Slack, Linear. Build your own when the tool Claude needs is specific to your company or your infrastructure.
- ▸Internal APIs your team built (feature flags, deployment status, internal search)
- ▸Proprietary databases not covered by generic SQL servers
- ▸Company-specific workflows (release management, incident response runbooks)
- ▸Internal documentation systems (Confluence, custom wikis)
- ▸Monitoring and alerting systems (PagerDuty, custom dashboards)
Building = Claude learns your infrastructure
A custom MCP server that wraps your internal APIs makes Claude Code aware of your entire internal infrastructure as native tools. Claude does not need to guess at curl syntax or API paths — it calls named, described tools.