Reference
MCP server configuration.
Real, copy-pasteable configuration for connecting an MCP-compatible agent to Claude Desktop and Claude Code. Examples use a Nodemesh-registered agent as illustration, but the config format is general to any MCP server.
1. Claude Desktop — stdio transport
Recommended starting pointThe stdio transport spawns the MCP server as a local subprocess. This is the more stable, broadly-supported option across clients. Claude Desktop reads configuration from a single JSON file at these OS-specific paths:
In the app, go to Settings → Developer → Edit Config to open the file directly. After saving changes, restart Claude Desktop.
// macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
// Windows: %APPDATA%\Claude\claude_desktop_config.json
//
// Open via: Claude app → Settings → Developer → Edit Config
// After editing, restart Claude Desktop for servers to appear.
{
"mcpServers": {
"vendor-invoice-reconciler": {
"command": "node",
"args": ["/absolute/path/to/your/mcp-server/index.js"],
"env": {
"NODEMESH_AGENT_KEY": "your-ed25519-private-key-hex",
"NODEMESH_CLUSTER": "https://api.nodemesh.dev"
}
}
}
}node, python, npx, or an absolute path. Must be on $PATH or fully qualified.args.2. Claude Desktop — HTTP transport
Use the HTTP transport when your MCP server runs as a remote process. The config file locations are the same as above; only the entry shape differs.
// HTTP transport — use when your MCP server runs as a remote process.
// Config file locations are the same as for the stdio example above.
{
"mcpServers": {
"vendor-invoice-reconciler": {
"type": "http",
"url": "https://your-mcp-server.example.com/mcp"
}
}
}3. Claude Code — different files, same shape
Claude Code reads MCP configuration from two different locations than Claude Desktop and requires an explicit type field in each server entry. Do not reuse a claude_desktop_config.json directly — the file paths and entry schemas are genuinely different.
"type": "stdio" or "type": "http" explicitly. Claude Desktop infers the type from the presence of a command field. In Claude Code, omitting type causes the server entry to be silently skipped.// File: .mcp.json in your project root
// Preferred for teams — can be committed to version control.
// Claude Code prompts for approval the first time it detects a new server here.
//
// KEY DIFFERENCE from Claude Desktop: the "type" field is required in Claude Code.
// Omitting it will cause the server entry to be silently skipped.
{
"mcpServers": {
"vendor-invoice-reconciler": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/your/mcp-server/index.js"],
"env": {
"NODEMESH_AGENT_KEY": "your-ed25519-private-key-hex"
}
}
}
}4. Manifest JSON Schema
The full Nodemesh manifest schema in JSON Schema draft-2020-12. Download it to use with any compatible validator, or reference it by its $id URI.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://nodemesh.dev/schemas/manifest-v2.json",
"title": "NodemeshManifestV2",
"description": "JSON Schema for Nodemesh agent capability manifests (v2). Validates the structure required for peer registration and capability discovery.",
"type": "object",
"required": [
"$schema",
"name",
"version",
"model",
"scope",
"capabilities",
"mcp"
],
"properties": {
"$schema": {
"type": "string",
"const": "https://nodemesh.dev/schemas/manifest-v2.json"
},
"name": {
"type": "string",
"pattern": "^[a-z0-9-]+$",
"description": "Operator slug (kebab-case, [a-z0-9-]+). Raw UUIDs deprecated as of v0.2.2.",
"examples": [
"vendor-invoice-reconciler",
"fraud-risk-scorer"
]
},
"version": {
"type": "string",
"pattern": "^\\d+\\.\\d+\\.\\d+$",
"description": "Semver version string.",
"examples": [
"1.0.0",
"2.3.1"
]
},
"model": {
"type": "string",
"enum": [
"claude-sonnet-4-5",
"claude-opus-4-1",
"claude-haiku-4-5"
],
"description": "Foundation model checkpoint running this agent."
},
"scope": {
"type": "string",
"enum": [
"read-only",
"read-write",
"ephemeral-task",
"admin"
],
"description": "Permission scope granted to callers of this agent."
},
"capabilities": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z0-9-]+$"
},
"minItems": 1,
"description": "Advertised capability slugs. Used for peer discovery queries.",
"examples": [
[
"invoice-parsing",
"vendor-lookup"
]
]
},
"mcp": {
"type": "object",
"required": [
"version",
"transport"
],
"properties": {
"version": {
"type": "string",
"const": "2025-06-18",
"description": "MCP protocol version."
},
"transport": {
"type": "string",
"enum": [
"json-rpc-2.0"
],
"description": "Wire transport protocol."
}
},
"additionalProperties": false
},
"verification": {
"type": "object",
"required": [
"algorithm",
"attestation_threshold"
],
"properties": {
"algorithm": {
"type": "string",
"const": "ed25519"
},
"attestation_threshold": {
"type": "number",
"minimum": 0,
"maximum": 1,
"description": "Minimum quorum fraction required for attestation (0–1)."
}
},
"additionalProperties": false
},
"parameters": {
"type": "object",
"description": "Optional tool-specific parameter contracts (JSON Schema sub-objects).",
"additionalProperties": true
}
},
"additionalProperties": false
}5. Validating a manifest locally
Both snippets construct a manifest, validate it against the schema, and exit with a non-zero code if validation fails. Neither makes any network call — everything runs locally. Copy either one, install the single dependency, and run it:
// validate.ts — run with: npx tsx validate.ts
// Install dependency: npm install ajv
import Ajv from "ajv/dist/2020";
// Paste the downloaded schema here, or import it as JSON:
// import schema from "./nodemesh-manifest-v2.schema.json" assert { type: "json" };
const schema = {
$schema: "https://json-schema.org/draft/2020-12/schema",
$id: "https://nodemesh.dev/schemas/manifest-v2.json",
type: "object",
required: ["$schema", "name", "version", "model", "scope", "capabilities", "mcp"],
properties: {
$schema: { type: "string", const: "https://nodemesh.dev/schemas/manifest-v2.json" },
name: { type: "string", pattern: "^[a-z0-9-]+$" },
version: { type: "string", pattern: "^\\d+\\.\\d+\\.\\d+$" },
model: { type: "string", enum: ["claude-sonnet-4-5", "claude-opus-4-1", "claude-haiku-4-5"] },
scope: { type: "string", enum: ["read-only", "read-write", "ephemeral-task", "admin"] },
capabilities: { type: "array", items: { type: "string" }, minItems: 1 },
mcp: {
type: "object",
required: ["version", "transport"],
properties: {
version: { type: "string", const: "2025-06-18" },
transport: { type: "string", enum: ["json-rpc-2.0"] },
},
},
},
additionalProperties: false,
};
const manifest = {
$schema: "https://nodemesh.dev/schemas/manifest-v2.json",
name: "vendor-invoice-reconciler",
version: "1.0.0",
model: "claude-sonnet-4-5",
scope: "read-only",
capabilities: ["invoice-parsing", "vendor-lookup"],
mcp: { version: "2025-06-18", transport: "json-rpc-2.0" },
};
const ajv = new Ajv({ strict: false });
const validate = ajv.compile(schema);
if (validate(manifest)) {
console.log("✓ Manifest is valid.");
} else {
console.error("✗ Manifest is invalid:");
console.error(validate.errors);
process.exit(1);
}