DEV Community

Cover image for The 3 MCP Servers Every AI Agent Needs in Production
whiteknightonhorse
whiteknightonhorse

Posted on

The 3 MCP Servers Every AI Agent Needs in Production

Your AI agent is probably missing two-thirds of what it needs

Most agents ship with one capability: text generation. Some get tool access — usually a single API or a browser. But in production, agents need three fundamentally different types of tools:

  1. Documentation context — reading library docs, API references, changelogs
  2. Browser interaction — navigating pages, filling forms, taking screenshots
  3. Real-world data — flights, weather, stock prices, government records, package metadata

No single MCP server covers all three. But three servers together do. Here's how I wire Context7, Playwright, and APIbase into one agent — and why the combination matters.

Why three servers, not one?

The Model Context Protocol lets an agent connect to multiple tool servers simultaneously. Each server exposes its tools through the same protocol, so the agent sees one flat catalog regardless of how many servers are behind it.

But MCP servers specialize. A documentation server optimizes for RAG over markdown. A browser server manages headless Chrome sessions. An API gateway handles auth, caching, rate limits, and payment for upstream providers.

Trying to do all three in one server means doing all three badly. The separation is intentional.

Here's the architecture:

┌──────────────┐
│   AI Agent   │
│  (your code) │
└──────┬───────┘
       │ MCP (Streamable HTTP)
       ├──────────────────────────────────┐
       │                                  │
┌──────▼───────┐  ┌──────────────┐  ┌─────▼──────────┐
│  Context7    │  │  Playwright  │  │  APIbase       │
│  (docs/code) │  │  (browser)   │  │  (487 APIs)    │
└──────────────┘  └──────────────┘  └────────────────┘
Enter fullscreen mode Exit fullscreen mode

Let me walk through each one.


Server 1: Context7 — Up-to-date documentation

What it does: Fetches live documentation for libraries and frameworks. Instead of relying on the LLM's training data (which is always months behind), Context7 pulls the current docs at query time.

Why agents need it: LLMs hallucinate API signatures. A lot. If your agent is generating code that calls pandas.DataFrame.to_parquet(), it needs the current parameter list — not what GPT memorized from 2024 docs.

Key tools:

  • resolve — finds the right library by name
  • get-library-docs — retrieves documentation for a specific topic
# Example: Get current Next.js App Router docs
result = await agent.call_tool("context7", "resolve", {
    "libraryName": "next.js"
})
# Returns: library_id = "/vercel/next.js"

docs = await agent.call_tool("context7", "get-library-docs", {
    "libraryId": "/vercel/next.js",
    "topic": "app router middleware"
})
# Returns: current markdown docs, not stale training data
Enter fullscreen mode Exit fullscreen mode

Setup: Free, open source, no API key needed.

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Limitation: Only covers libraries indexed in their registry. If you're using a niche library, you'll get nothing. But for popular frameworks (React, Next.js, FastAPI, LangChain), it's solid.


Server 2: Playwright MCP — Browser automation

What it does: Gives the agent a headless browser. Navigate pages, click buttons, fill forms, take screenshots, extract content from rendered JavaScript.

Why agents need it: Not everything has an API. Job application forms, internal dashboards, CMS interfaces, legacy web apps — your agent needs a browser for these.

Key tools:

  • browser_navigate — go to a URL
  • browser_click — click an element
  • browser_type — fill input fields
  • browser_screenshot — capture the current page
  • browser_snapshot — get accessibility tree (structured page content)
# Example: Check a competitor's pricing page
await agent.call_tool("playwright", "browser_navigate", {
    "url": "https://competitor.com/pricing"
})

snapshot = await agent.call_tool("playwright", "browser_snapshot", {})
# Returns: structured accessibility tree of the pricing page
# Agent can now parse tiers, prices, feature lists
Enter fullscreen mode Exit fullscreen mode

Setup: Runs locally via npx (no remote server needed for dev):

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@anthropic-ai/mcp-server-playwright"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Limitation: Headless browser is slow (2-5 seconds per action). Rate-limited by nature. Not suitable for bulk data retrieval — that's what APIs are for.


Server 3: APIbase — 487 real-world APIs through one endpoint

What it does: Unified MCP gateway to 487 tools from 150 upstream providers. Travel, finance, weather, government data, science, e-commerce, jobs, entertainment, dev tools — all through one connection.

Why agents need it: An agent that can only browse the web and read docs is still missing structured data. It can't check flight prices, look up stock quotes, query US Census data, or search npm packages without an API. And wiring 150 separate APIs means managing 150 auth flows, rate limits, and response formats.

APIbase handles that. One MCP endpoint, one auth token (or no token — auto-registration), pay-per-call pricing.

Key tools (487 total, here are 10 across categories):

Tool What it returns Price
amadeus.flights.search Real-time flight prices, routes, airlines $0.035
coingecko.crypto.price Live crypto prices for any token $0.001
serper.search.web Google search results as JSON $0.002
census.gov.population US Census population data by state/county $0.001
npm.registry.package_info npm package metadata, versions, downloads $0.001
hf.hub.models HuggingFace model search (1M+ models) $0.001
noaa.weather.forecast US weather forecasts by coordinates $0.002
congress.gov.bills US Congressional bills and legislation $0.001
gbif.species.search Global biodiversity occurrence data $0.001
osv.security.query Vulnerability database (npm, PyPI, Go, etc.) $0.001
# Example: Search for flights from NYC to London
curl -X POST https://apibase.pro/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
      "name": "amadeus.flights.search",
      "arguments": {
        "origin": "JFK",
        "destination": "LHR",
        "date": "2026-05-15",
        "adults": 1
      }
    },
    "id": 1
  }'
Enter fullscreen mode Exit fullscreen mode

Response (trimmed):

{
  "result": {
    "content": [{
      "type": "text",
      "text": "{\"flights\":[{\"airline\":\"BA\",\"price\":\"412.00\",\"currency\":\"USD\",\"departure\":\"2026-05-15T19:00:00\",\"arrival\":\"2026-05-16T07:15:00\",\"stops\":0}]}"
    }]
  }
}
Enter fullscreen mode Exit fullscreen mode

Setup:

{
  "mcpServers": {
    "apibase": {
      "url": "https://apibase.pro/mcp"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

No API key required for initial connection — auto-registration gives you credentials on first request. Payment is x402 USDC micropayments (from $0.001 to $1.00 per call depending on the tool).

Limitation: Paid per call. Not suitable for bulk scraping or high-frequency polling. Use the browser server for web scraping, APIbase for structured data.


Wiring all three together

Here's a complete Python example using the OpenAI Agents SDK with all three servers:

import asyncio
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHTTP

async def main():
    # Connect to all 3 MCP servers
    context7 = MCPServerStreamableHTTP(
        name="context7",
        url="https://mcp.context7.com/mcp"
    )
    playwright = MCPServerStreamableHTTP(
        name="playwright",
        url="http://localhost:3001/mcp"  # local Playwright server
    )
    apibase = MCPServerStreamableHTTP(
        name="apibase",
        url="https://apibase.pro/mcp"
    )

    async with context7, playwright, apibase:
        # Gather tools from all servers
        all_tools = (
            await context7.list_tools() +
            await playwright.list_tools() +
            await apibase.list_tools()
        )

        agent = Agent(
            name="research-agent",
            instructions="""You are a research agent with 3 capabilities:
            1. Context7: look up current library documentation
            2. Playwright: browse websites and interact with pages
            3. APIbase: query 487 real-world APIs (flights, finance,
               weather, government data, science, jobs, etc.)

            Use the right tool for each task. Prefer APIs over
            browser automation when structured data is available.""",
            tools=all_tools,
        )

        result = await Runner.run(
            agent,
            "Find the cheapest JFK→LHR flight for May 15, "
            "then check the current GBP/USD exchange rate, "
            "and look up London weather for that date."
        )
        print(result.final_output)

asyncio.run(main())
Enter fullscreen mode Exit fullscreen mode

The agent sees one combined tool catalog. It picks amadeus.flights.search for flights, finance.exchange.ecb_rates for the exchange rate, and weatherapi.forecast for London weather — all from APIbase. If it needed to check a website that doesn't have an API, it'd use Playwright. If it needed current docs for a library it's using, it'd call Context7.

Three servers. One agent. Full coverage.


When to use which server

Task Best Server Why
Get current React docs Context7 Up-to-date library docs, not stale training data
Fill out a web form Playwright Needs browser interaction, no API available
Search flight prices APIbase Structured API data, faster and cheaper than scraping
Read a blog post Playwright Rendered HTML, may need JavaScript
Query US Census data APIbase Government API, returns structured JSON
Check npm package versions APIbase Registry API, no browser needed
Navigate a dashboard Playwright Interactive UI, login required
Get stock quotes APIbase Real-time financial data via API
Look up LangChain docs Context7 Framework docs that change frequently
Take a webpage screenshot Playwright Visual capture, needs rendering engine

The rule of thumb: if structured data exists via an API, use APIbase. If you need a browser, use Playwright. If you need current docs, use Context7.


What I learned running all three in production

Token efficiency matters. APIbase exposes 487 tools. Loading all of them into context is wasteful. Instead, I use the discover_tools prompt with a category filter:

curl -X POST https://apibase.pro/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "prompts/get",
    "params": {
      "name": "discover_tools",
      "arguments": {"category": "finance"}
    },
    "id": 1
  }'
Enter fullscreen mode Exit fullscreen mode

This returns only the ~40 finance tools instead of all 487. The agent gets what it needs without burning 10K tokens on tool definitions.

Browser is the fallback, not the default. Agents instinctively reach for the browser because it's the most general tool. But browser actions are 10-50x slower than API calls and cost more in tokens (accessibility trees are verbose). Train your agent to check APIbase first, browser second.

Cache TTLs vary wildly. Crypto prices cache for 5 seconds. Walk Score data caches for 7 days. Census data caches for 24 hours. This is handled per-tool on the server side — your agent doesn't need to think about it. But it matters for cost: repeated calls to cached endpoints are cheaper.


Try it yourself

1. Connect to all three in Claude Desktop:

Edit ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp"
    },
    "apibase": {
      "url": "https://apibase.pro/mcp"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

(Playwright requires a local process — see the Playwright MCP docs for setup.)

2. Ask your agent:

"Search for direct flights from SFO to Tokyo for next month, check the current JPY exchange rate, and find the weather forecast for Tokyo on the arrival date."

The agent will use amadeus.flights.search, finance.exchange.ecb_rates, and weatherapi.forecast — three API calls, one agent, real data.

3. Browse the full tool catalog:

curl -s https://apibase.pro/api/v1/tools | python3 -m json.tool | head -50
Enter fullscreen mode Exit fullscreen mode

487 tools across 22 categories. Travel, finance, weather, science, government, jobs, entertainment, dev tools, and more.


APIbase is open source — GitHub. Integration guides for OpenAI SDK, LangChain, Google ADK, and more at apibase.pro/frameworks.

Top comments (0)