MCP Server

NyanCAD provides a Model Context Protocol (MCP) server that allows LLM clients to interact with your schematics, component library, and simulations. This enables AI assistants to help you design circuits, analyze simulation results, and manage your component library.

Connecting to the MCP Server

NyanCAD Cloud

For the hosted NyanCAD service, use the following MCP server URL:

https://nyancad.com/ai/mcp

Self-Hosted Deployments

For your own nyancad-server deployment, the MCP server is available at:

https://your-server-url/ai/mcp

Replace your-server-url with your deployment’s base URL.

Adding to LLM Clients

Claude Desktop

Add the following to your Claude Desktop configuration file (claude_desktop_config.json):

{
  "mcpServers": {
    "nyancad": {
      "url": "https://nyancad.com/ai/mcp"
    }
  }
}

The configuration file location depends on your operating system:

Claude Code

Add the MCP server using the Claude Code CLI:

claude mcp add nyancad --transport http https://nyancad.com/ai/mcp

Other MCP Clients

Any MCP-compatible client can connect using the HTTP transport with the server URL. The server uses OAuth authentication - you will be prompted to log in with your NyanCAD account when first connecting.

Authentication

The MCP server uses OAuth 2.0 authentication. When you connect from an LLM client:

  1. The client will open a browser window to authenticate
  2. Log in with your NyanCAD account credentials
  3. Authorize the MCP client to access your account
  4. The client will receive a token to make authenticated requests

Your schematics and component library are private to your account. The MCP server accesses your personal database using the authenticated session.

Available Tools

The MCP server exposes the following tools:

get_schematic

Get a schematic with computed port locations and SPICE netlist.

Parameters:

Provide either id or name. If name is provided, the tool searches your library and uses the first matching schematic.

Returns:

list_library

List available component models with optional filtering.

Parameters:

Returns: Dictionary mapping model IDs to ModelMetadata objects. Use the dictionary keys (e.g., models:1ef9c9d7-...) as identifiers in other tools.

bulk_update_schematic

Bulk update schematic documents (create, update, or delete devices).

Parameters:

Document requirements:

Conflict resolution: If you receive a conflict error, fetch the latest document with get_schematic() to get the current _rev, then retry.

update_model

Update a single model in the library (create, update, or delete).

Parameters:

Operations:

get_simulation_result

Get the latest simulation result for a schematic.

Parameters:

Returns: Dictionary containing the simulation result data, or empty dict if none found.

hello

Test authentication by verifying the JWT token with CouchDB. Useful for debugging connection issues.

Example Usage

Here are some example prompts you can use with an LLM client connected to the NyanCAD MCP server:

Data Model

Devices

Schematics contain two types of devices:

Both device types include computed ports field showing connection points as (x,y): port_name mappings.

Models

Component models define the symbol, SPICE template, and parameters for circuit elements. Models are referenced by ID (e.g., models:1ef9c9d7-...) and can be browsed using list_library.

Troubleshooting

Authentication Fails

Ensure you have a valid NyanCAD account and can log in to the web interface. The MCP server uses the same authentication system.

Connection Refused

For self-hosted deployments, verify that:

Conflict Errors

When updating documents, always fetch the latest version first to get the current _rev. CouchDB uses optimistic concurrency control and will reject updates with stale revision numbers.