MCP Server Examples: 12 Real Model Context Protocol Uses

EngineeringAugust 22, 20267 min readBy PinVari
MCP Server Examples: 12 Real Model Context Protocol Uses

These mcp server examples show a local or remote process that exposes tools to AI coding agents via the Model Context Protocol. The agent calls a tool by name and gets structured JSON back.

You can connect them to Claude Code, Cursor, or Codex today. Each card lists repo, install, and tools.

Most guides stop at the spec or one toy. This list is twelve you can run.

What is an MCP server and why does my agent need one?

An MCP server gives your AI coding agent data or actions that do not fit in the prompt. It listens on stdio or HTTP, takes a JSON-RPC tool call, and returns a result.

The filesystem server exposes read_file, write_file, list_directory, and search_files. Claude Code searches, reads, and edits without you pasting files.

The protocol is open. Servers run locally by default on 127.0.0.1.

You bring keys for GitHub, Linear, or Slack when the server needs them.

Key

MCP servers implement tools/list and tools/call. Any language works. Python and TypeScript dominate because the SDKs and reference servers use them.

How do I connect an MCP server to Claude Code or Cursor?

Both editors read a JSON file of launch commands. Claude Code: ~/Library/Application Support/Claude/claude_desktop_config.json.

Cursor: ~/.cursor/mcp.json.

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/you/projects"]
    }
  }
}

Restart the editor. Failed starts show up in ~/Library/Logs/Claude/mcp*.log or the dev console.

PinVari → Connect → Claude Code / Cursor installs ~/.pinvari/mcp/pinvari-mcp and writes the entry. The app must be running (127.0.0.1:3402).

No hand-edited JSON.

12 working MCP server examples you can run today

Each card is one server. Copy the config, restart, use the tools.

1. Filesystem

Repo: @modelcontextprotocol/server-filesystem

Install: npx -y @modelcontextprotocol/server-filesystem /path/to/allowed/directory

Tools: read_file, write_file, list_directory, search_files, get_file_info

Let the agent read and scaffold without leaving chat. Pass only allowed directories.

Paths outside the list are rejected.

"filesystem": {"command":"npx","args":["-y","@modelcontextprotocol/server-filesystem","/Users/you/projects"]}
Tip

Pass only directories the agent should touch. The server rejects paths outside the allowlist.

2. GitHub

Repo: @modelcontextprotocol/server-github

Install: npx -y @modelcontextprotocol/server-github

Tools: create_issue, get_issue, list_issues, search_repositories, create_pull_request

Set GITHUB_PERSONAL_ACCESS_TOKEN with repo and read:org. File issues or search the org from chat.

Repo: @modelcontextprotocol/server-brave-search

Tools: brave_web_search, brave_local_search

Needs BRAVE_API_KEY. Free tier is 2,000 queries/month at search.brave.com/api.

Use it to ground answers in current docs.

4. Headless browser package

Repo: the official Model Context Protocol browser server package

Tools: load a URL, capture a page image, run a small script in the page

Launches a headless Chromium session. Useful for a login path or a rendered-page image.

5. Postgres

Repo: @modelcontextprotocol/server-postgres

Tools: query, list_tables, describe_table

Pass a connection URL. Point at dev or test only.

The agent can run any SQL that URL allows.

Heads up

Point this at a dev/test database. The agent can execute any SQL the connection string allows.

6. Slack

Repo: @modelcontextprotocol/server-slack

Tools: slack_post_message, slack_list_channels, slack_list_users

Needs SLACK_BOT_TOKEN with chat:write, channels:read, users:read. Post a build note or forward a capture.

7. Memory

Repo: @modelcontextprotocol/server-memory

Tools: store_memory, recall_memory, delete_memory, list_memories

Stores notes in ~/.mcp-memory/memory.json. Use it for stack conventions across chats.

8. PinVari (named UI elements)

Install: PinVari → Connect, or claude mcp add --scope user pinvari -- "$HOME/.pinvari/mcp/pinvari-mcp"

Tools: pinvari_next_instruction, pinvari_mark_done, pinvari_request_capture

Hold the PinVari hotkey, circle, speak. The agent gets role, label, frame, confidence, crop, and your words.

Download is $39 launch.

The connector talks to the app on 127.0.0.1:3402. AX first, on-device OCR on canvas.

The agent edits the control you circled.

"pinvari": {"command":"/Users/you/.pinvari/mcp/pinvari-mcp"}

9. SQLite

Repo: @modelcontextprotocol/server-sqlite

Tools: query, list_tables, describe_table

Pass the .db path. Useful for fixtures and local analytics exports.

10. EverArt

Repo: @modelcontextprotocol/server-everart

Tools: generate_image

Needs EVERART_API_KEY. Placeholder assets from a prompt.

11. Google Maps

Repo: @modelcontextprotocol/server-google-maps

Tools: geocode, reverse_geocode, search_places, get_directions, get_distance

Needs GOOGLE_MAPS_API_KEY. Address checks without leaving the editor.

12. Sequential Thinking

Repo: @modelcontextprotocol/server-sequential-thinking

Tools: sequentialThinking

Returns a structured "break this into steps" prompt. Useful before a large refactor.

MCP server examples in Python (code walkthrough)

Install mcp (pip install mcp). Decorate list_tools and call_tool.

Minimal clock server:

from mcp.server import Server
from mcp.types import Tool
import datetime

server = Server("time-server")

@server.list_tools()
async def list_tools() -> list[Tool]:
    return [Tool(name="get_current_time", description="Returns the current UTC time",
                 inputSchema={"type":"object","properties":{}})]

@server.call_tool()
async def call_tool(name: str, arguments: dict):
    if name == "get_current_time":
        return {"time": datetime.datetime.utcnow().isoformat()}

if __name__ == "__main__":
    import asyncio
    from mcp.server.stdio import stdio_server
    asyncio.run(stdio_server(server))

Config: "time": {"command":"python3","args":["/path/to/time_server.py"]}.

stdio_server owns JSON-RPC on stdin/stdout. The agent sends tools/call; you return ISO time.

MCP server OAuth example (authenticating external services)

Some servers need a user token. Pattern: an authorize tool returns a URL.

The user finishes the flow. The server stores the token.

  1. Agent calls authorize and gets the Google URL.
  2. You grant Calendar access.
  3. Redirect hits localhost with a code.
  4. Server swaps code for a token.
  5. Later list_events calls use that token.

Reference Drive and Gmail servers use this. See their GitHub repos for full code.

Key

Never commit OAuth tokens. Use env vars or the OS keychain (keyring in Python, keytar in Node).

MCP server sampling example (agents requesting more data mid-task)

Sampling lets a server ask the LLM for a short completion. A review server can send a diff and ask for security notes, then fold that into the tool result.

{
  "method": "sampling/createMessage",
  "params": {
    "messages": [
      {"role":"user","content":"What are the security risks in this diff?"}
    ],
    "maxTokens": 500
  }
}

The client runs the completion and returns it. Example 12 uses sampling for the step list.

When should I build my own MCP server versus use an existing one?

Build when you expose a private API, pre-process data (Figma to prop types), or merge Linear plus GitHub plus Slack in one tool.

Use a reference server when it already exists. The org ships 20+ servers; the community has Notion, Stripe, AWS, and more.

Fastest test: fork a reference server, add one tool, connect it. Most stay under 200 lines.

How do I debug an MCP server that won't connect?

Read logs first. Claude: ~/Library/Logs/Claude/mcp-server-[name].log.

Cursor: ~/.cursor/logs/mcp.log.

  • ENOENT — bad command or npx not on PATH.
  • Connection refused — crash on boot; missing env or import.
  • Tool call timeout — over 30s; tighten the tool.

Test standalone: run command + args, type a tools/list JSON-RPC request. A live server returns a tool list.

Log on stderr, not stdout. MCP owns stdout.

Comparison: MCP servers vs custom agent scripts

MCP server

Setup: about five minutes.

Reusable: yes, across chats and editors.

Freshness: live tool calls.

Custom Python script

Setup: about a minute.

Reusable: no. You paste output.

Freshness: a snapshot.

Paste text into chat

Setup: thirty seconds.

Reusable: no.

Freshness: a snapshot.

Use MCP when you will need the same data again or the agent should act on its own. Grep-and-paste is faster for a one-off TODO list.

FAQ

What happens if an MCP server crashes mid-conversation?

The agent gets a JSON-RPC disconnect and can retry. Most editors restart the process.

PinVari's connector asks you to open the app, then reconnects.

Can I connect multiple MCP servers at once?

Yes. Each is its own process.

One chat can call github, filesystem, and pinvari together.

Do MCP servers work with local LLMs or only Claude?

The protocol is LLM-agnostic. As of August 2026, Claude Code, Cursor, Codex, and Zed implement a client.

Community clients exist for Ollama. The server does not care which model sits above it.

How do I pass secrets without hardcoding them?

Put them in the env block as "$GITHUB_TOKEN". Set the variable in ~/.zshrc and restart the editor.

Do not commit tokens.

Can an MCP server access my screen or microphone?

Only if you build that in. Reference servers do not.

PinVari captures when you invoke the hotkey — no passive monitor, nothing uploaded by default.

What's the difference between an MCP server and a Copilot extension?

Copilot extensions run in GitHub's cloud and need approval. MCP servers run locally and start now.

They only work in editors that implement the client spec.

Hand your agent the exact element

PinVari resolves what you point at into a named, executable instruction — on-device, no keys, your own agent. One click inside PinVari connects Claude Code, Cursor, VS Code or Codex — or paste one CLI line from pinvari.com/connect.

PinVari → Connect → your agent (one click)
Get PinVari — $39 →