NEURALNG
AI REFERENCE

MCP Server

Give coding agents deterministic access to NeuralNg component contracts, package exports and compact theme recipes without placing MCP runtime code in the Angular application.

Read-onlystdio transportNo network access

DEVELOPMENT TOOLING

Separate from the browser runtime

@neural-ng/mcp-server is a Node.js development package. An MCP host starts it as a child process and exchanges JSON-RPC messages over standard input/output. Your Angular bundle never imports the server or its protocol dependencies.

MCP host

Starts the process, presents tools and decides when to call them.

NeuralNg server

Resolves a committed catalog and runs deterministic read-only operations.

Angular project

Receives generated code through the agent, never through the MCP process.

Install and connect

Node.js 24 is required by the alpha package. A project-local exact version is recommended because the catalog, tool schemas and installed component version should move together.

terminal Bash
npm install --save-dev @neural-ng/[email protected]

Generic client configuration

Place this object in the MCP configuration location expected by your editor or agent host, then restart or reload its MCP connections.

mcp.json JSON
{
  "mcpServers": {
    "neural-ng": {
      "command": "npx",
      "args": ["--no-install", "neural-ng-mcp"]
    }
  }
}
On Windows, a host that does not resolve command shims may require npx.cmd. This is a client process-spawning difference, not a NeuralNg configuration option.

One-off evaluation

terminal Bash
npx -y @neural-ng/[email protected]

The process intentionally stays open while connected. Standard output is reserved for protocol messages; fatal startup diagnostics go to standard error.

Component discovery tools

Discovery uses a generated local catalog. Search and recommendation are deterministic text/intent matching; no second model or remote service is invoked.

ToolInputPurpose
search_components query: string, limit?: 1..20 Search selectors, entry points, summaries, README and llms.txt.
get_component_contract component: string Resolve by catalog ID, class, selector or public entry point.
recommend_components goal: string, limit?: 1..20 Return deterministic matches for a described UI goal.

Search

arguments.json JSON
{
  "query": "localized date range input",
  "limit": 5
}

Contract

arguments.json JSON
{
  "component": "neural-date-picker"
}

Recommend

arguments.json JSON
{
  "goal": "nullable inherited permission checkbox",
  "limit": 3
}

Compact theme tools

Theme tools operate on a small schema-versioned recipe rather than sending the complete resolved Core and Editor token graph through model context. Neutral is the release baseline; Glass, Mist and Futuristic are experimental preview inputs.

ToolInputPurpose
create_theme_recipe name, options_json? Create and validate a compact sparse recipe.
validate_theme_recipe recipe_json Validate schema, aliases and token ownership.
edit_theme_recipe recipe_json, patch_json Apply bounded dotted set/unset operations and revalidate.
diff_theme_recipes left_json, right_json Return changed recipe paths only.
get_component_theme_contract component, detail? Read supported property names or current defaults.
compile_theme_recipe recipe_json Return diagnostics, summary, sizes and integration instructions.

Create

arguments.json JSON
{
  "name": "violet-workspace",
  "options_json": "{\"preset\":\"neutral\",\"primary\":\"#7c3aed\",\"radius\":\"large\"}"
}

Edit

arguments.json JSON
{
  "recipe_json": "{\"schemaVersion\":1,\"name\":\"violet-workspace\",\"extends\":\"neutral\"}",
  "patch_json": "{\"set\":{\"color.primary\":\"#7c3aed\",\"shape.radius\":\"large\"}}"
}
compile_theme_recipe returns validation, diagnostics, summary, artifact byte sizes and integration instructions. It does not write CSS. Use npx neural-theme build when the user explicitly wants artifacts generated.

Resources are addressable context

Resources expose package-wide catalogs and per-component documents. Component URIs are generated for every public catalog entry, so the list grows with the library while URI structure stays predictable.

resource-uris.txt HTML
neural://catalog
neural://package/exports
neural://components/button/contract
neural://components/button/readme
neural://components/button/llms

neural://themes/catalog
neural://themes/schema
neural://themes/presets
neural://themes/presets/neutral
neural://themes/ai-guide

Contract

Small JSON: selector, entry point, status, models, forms and related components.

llms.txt

Compact strict rules optimized for code generation.

README

Long-form examples, behavior, accessibility and migration guidance.

Token-efficient agent workflow

Start narrow and expand context only when necessary. A contract usually answers import and model questions; loading every README before choosing a component wastes context and increases conflicting guidance.

agent-workflow.txt HTML
1. Call search_components with the user's intent.
2. Call get_component_contract for the selected result.
3. Read neural://components/{id}/llms for strict usage rules.
4. Import the exact entryPoint and use the returned selector/models.
5. Read the README only when examples or deeper behavior are required.
6. Never invent an input, output, class name or compatibility alias.

Results and domain errors

Successful tools return pretty-printed JSON in one text content block. Invalid component references, malformed JSON and rejected theme values return isError: true with a human-readable message.

tool-result.json JSON
{
  "content": [
    {
      "type": "text",
      "text": "{\n  \"matches\": [\n    \"...\"\n  ]\n}"
    }
  ]
}

// Domain or validation failure:
{
  "isError": true,
  "content": [
    {
      "type": "text",
      "text": "Unknown NeuralNg component: ..."
    }
  ]
}

Read-only security boundary

Every tool declares readOnlyHint: true, destructiveHint: false, idempotentHint: true and openWorldHint: false. These annotations help clients describe risk; the implementation also enforces the boundary by exposing no write or external I/O operation.

No project writes

No path argument and no arbitrary file reader.

No shell execution

Tools cannot install packages or run project commands.

No network

Search and recommendations use committed local data.

Prototype-safe patches

Theme edits accept bounded known paths and reject unsafe keys.

CSS validation

External URLs, declaration injection and malformed aliases are rejected.

Private process

stdio is a single client-owned local process, not an HTTP endpoint.

MCP annotations are descriptive hints, not a sandbox. Pin trusted packages and let the client apply its own process, filesystem and network controls.

Keep package versions aligned

The generated catalog describes the version shipped inside the MCP package. Pin the same NeuralNg prerelease family in the project and restart the MCP process after upgrades so the agent does not reason from an older contract.

The current server is 0.1.0-beta.0 and requires Node >=24 <25. Alpha tool names, result shapes and catalog contents may still change; pin the exact version in shared repositories.

Troubleshooting

Process exits immediately

Confirm Node 24, the exact package version and the client working directory.

No tools appear

Reload MCP connections and inspect client logs plus server stderr.

Non-protocol stdout

Do not wrap the command with scripts that print banners to stdout.

Package not found

Install locally and use --no-install, or verify registry access for the one-off command.

Old component contract

Update the MCP package and restart its process; catalogs are generated at package build time.

Theme recipe rejected

Read neural://themes/schema, patch only known paths, then validate again.