Connects MCP servers to AI clients including Claude Desktop, Claude Code, Cursor, and custom apps. Covers config file locations, auth, and debugging connection failures.
Ships in mcp-mastery. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Wire any MCP server into the client that will consume it — declaratively for IDEs, programmatically for custom apps.
| Client | Config path |
|---|---|
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
| Claude Code | ~/.claude.json (user and local scope) or .mcp.json (project scope); add with claude mcp add |
| Cursor | ~/.cursor/mcp.json (user) or .cursor/mcp.json (project) |
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"]
}
}
}
{
"mcpServers": {
"linear": {
"type": "http",
"url": "https://mcp.linear.app/mcp"
}
}
}
Claude Code supports OAuth for remote servers: with no headers, authenticate from /mcp in a browser. For servers that take a static token, add "headers": { "Authorization": "Bearer ${TOKEN}" } (Claude Code expands ${VAR} and ${VAR:-default} in command, args, env, url, and headers). The legacy SSE transport ("type": "sse", often a /sse URL) is deprecated; prefer a server's Streamable HTTP endpoint.
Check a .mcp.json into the repo so teammates auto-inherit the right servers:
{
"mcpServers": {
"postgres-dev": {
"command": "npx",
"args": ["-y", "@bytebase/dbhub", "--dsn", "${DEV_DATABASE_URL:-postgresql://readonly@localhost:5432/dev}"]
}
}
}
Claude Code reads this on startup. Add .mcp.json to .gitignore only if it contains secrets; otherwise commit it.
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({
command: "npx",
args: ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"],
});
const client = new Client({ name: "my-app", version: "1.0.0" });
await client.connect(transport);
const tools = await client.listTools();
const result = await client.callTool({
name: "list_directory",
arguments: { path: "/Users/me/projects" },
});
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const transport = new StreamableHTTPClientTransport(
new URL("https://mcp.example.com/mcp"),
{ requestInit: { headers: { Authorization: `Bearer ${token}` } } },
);
await client.connect(transport);
The Messages API can call a remote MCP server for you (beta). Declare the server in mcp_servers and enable it with a matching mcp_toolset entry in tools; one without the other is rejected.
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();
const response = await client.beta.messages.create({
model: MODEL_ID, // a current model ID that supports the MCP connector
max_tokens: 4096,
betas: ["mcp-client-2025-11-20"],
mcp_servers: [
{
type: "url",
url: "https://mcp.example.com/mcp",
name: "example",
authorization_token: process.env.EXAMPLE_MCP_TOKEN,
},
],
tools: [{ type: "mcp_toolset", mcp_server_name: "example" }],
messages: [{ role: "user", content: "What tools do you have available?" }],
});
The API runs the MCP tool calls server-side and returns mcp_tool_use / mcp_tool_result blocks. Check the MCP connector docs for the current beta header (newer headers add features such as tool-list pinning) and supported models: https://platform.claude.com/docs/en/agents-and-tools/mcp-connector. The Claude Agent SDK is a separate product with its own mcpServers option.
~/Library/Logs/Claude/mcp*.log. Tail it while restarting the clientnpx -y @modelcontextprotocol/server-filesystem /tmp fails in your terminal, it'll fail for Claudecommand: "node" depends on PATH; prefer command: "/usr/local/bin/node" or npx${VAR} in all fields; inline the value or use an env manager@modelcontextprotocol/server-filesystem@<version>) for production CI; unpinned npx -y runs whatever is latest.mcp.json for team-shared servers, user-scoped for personal onesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mcp-client, mcp-config, claude-desktop, cursor, mcp-sdk, server-integration
Other plugins' skills for the same job
7 skills in this plugin
/mcp-auth-oauthImplement OAuth 2.1 + PKCE authentication for remote MCP servers, including dynamic client registration, token refresh, and scope design. Covers the 2025 MCP auth spec that Claude Desktop, Claude Code, and ChatGPT use.
Use this skill when building a remote MCP server that needs per-user auth, debugging OAuth flows for MCP, or migrating a bearer-token MCP server to OAuth.
Activate when: MCP OAuth, remote MCP auth, MCP authorization, PKCE, dynamic client registration, MCP 401.
/mcp-resource-patternsUse MCP Resources correctly — the read-only, URI-addressable data primitive — and know when to pick resources, tools, or prompts. Covers templated URIs, subscriptions, and common mistakes.
Use this skill when designing MCP servers that expose data, deciding between tool vs resource, or implementing resource subscriptions for live data.
Activate when: MCP resource, resource template, resource vs tool, subscribe resource, MCP URI schema.
/mcp-security-sandboxingSecure MCP servers against prompt injection, tool abuse, excessive permission, and data exfiltration. Covers per-tool scopes, rate limiting, audit logging, and sandbox patterns for shell-adjacent tools.
Use this skill when deploying an MCP server to production, handling untrusted agents, or reviewing an MCP server for security issues.
Activate when: MCP security, MCP prompt injection, tool sandbox, MCP audit log, MCP rate limit, tool abuse, MCP threat model.
/mcp-server-authoringBuild production-quality MCP (Model Context Protocol) servers that expose tools, resources, and prompts to AI clients like Claude Desktop, Claude Code, Cursor, and the Claude Agent SDK.
Use this skill when the user wants to build an MCP server, expose internal tooling to an AI agent, wrap an API for agents, or publish a reusable MCP server to a registry.
Activate when: MCP server, Model Context Protocol, expose tools to Claude, @modelcontextprotocol/sdk, mcp.json, stdio server, HTTP MCP server.
/mcp-tool-designDesign MCP tool schemas, names, and descriptions that AI agents actually pick correctly and use without hand-holding. Covers the anti-patterns that make agents loop, pick wrong tools, or hallucinate arguments.
Use this skill when designing or reviewing MCP tools, debugging "the agent isn't using my tool", or pruning a bloated tool surface.
Activate when: MCP tool design, tool description, agent picks wrong tool, too many tools, tool schema, tool naming.
/mcp-transport-stdio-httpChoose between MCP transports — stdio for local processes, Streamable HTTP for remote servers, SSE for legacy — and implement each correctly with reconnection, backpressure, and session handling.
Use this skill when deciding transport for a new MCP server, migrating SSE to Streamable HTTP, or debugging transport-level issues (connection drops, buffering, session loss).
Activate when: MCP transport, stdio vs HTTP, Streamable HTTP, MCP SSE, MCP reconnection, MCP session.
/mcp-mastery:mcp-client-integrationfrom mcp-mastery
npx claudepluginhub latestaiagents/agent-skills --plugin mcp-mastery2 plugins in one repository ship this exact skill · first indexed Nov 5, 2026