From latestaiagents
Connect MCP servers to AI clients — Claude Desktop, Claude Code, Cursor, the Claude Agent SDK, and custom apps — including config file locations, auth, and debugging connection failures. Use this skill when the user wants to wire an MCP server into a client, troubleshoot "server not connecting" errors, or build a custom MCP client with the SDK. Activate when: MCP client, mcp.json, claude_desktop_config.json, connect MCP, MCP not working, list MCP tools, programmatic MCP client.
npx claudepluginhub latestaiagents/agent-skills --plugin skills-authoringThis skill uses the workspace's default tool permissions.
**Wire any MCP server into the client that will consume it — declaratively for IDEs, programmatically for custom apps.**
Guides integration of Model Context Protocol (MCP) servers into Claude Code plugins via .mcp.json or plugin.json for external service tools, with scope management (local, project, user).
Manages Model Context Protocol (MCP) servers for Claude Code projects: installs/configures .mcp.json, OAuth remotes, runtime enable/disable, troubleshooting connections.
Manages MCP servers across coding agents like Claude Code, Cursor, VS Code: search, install via npx add-mcp or claude mcp, configure, update, remove.
Share bugs, ideas, or general feedback.
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/settings.json (user) or .mcp.json (project) |
| Cursor | ~/.cursor/mcp.json (user) or .cursor/mcp.json (project) |
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}
{
"mcpServers": {
"linear": {
"url": "https://mcp.linear.app/sse",
"headers": {
"Authorization": "Bearer ${LINEAR_TOKEN}"
}
}
}
}
Claude Code supports OAuth: omit headers and you'll be prompted to authenticate in-browser on first tool call.
Check a .mcp.json into the repo so teammates auto-inherit the right servers:
{
"mcpServers": {
"postgres-dev": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/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-github"],
env: { GITHUB_TOKEN: process.env.GITHUB_TOKEN! },
});
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: "create_issue",
arguments: { repo: "owner/repo", title: "Bug", body: "..." },
});
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const transport = new StreamableHTTPClientTransport(
new URL("https://mcp.example.com"),
{ requestInit: { headers: { Authorization: `Bearer ${token}` } } },
);
await client.connect(transport);
import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic();
const response = await client.beta.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 4096,
mcp_servers: [
{ type: "url", url: "https://mcp.linear.app/sse", name: "linear" },
],
messages: [{ role: "user", content: "List my open Linear issues" }],
});
The SDK handles tool-use loop internally.
~/Library/Logs/Claude/mcp*.log. Tail it while restarting the clientnpx -y @modelcontextprotocol/server-github 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 managernpx -y over local installs — updates flow automatically@modelcontextprotocol/server-github@1.2.3) for production CI.mcp.json for team-shared servers, user-scoped for personal ones