Skip to main content
Glama
README.md
# Skill Router MCP

Skill Router MCP is a local, read-only router for large collections of agent skills. It indexes installed `SKILL.md` files, searches their metadata and workflows, reports duplicate definitions, and recommends a transparent candidate set to an AI agent.

The router does not execute skills and does not make the final choice. It returns:

- primary candidates;
- complementary skills;
- additional candidates that might otherwise be hidden by a small result limit;
- invocation mode (`automatic`, `manual-only`, or unspecified);
- matching evidence and duplicate paths.

No LLM, embedding API, account, telemetry, or network call is used for routing.

## MCP tools

- `inventory_skills` — summarizes indexed roots, invocation modes, duplicate names, and read errors.
- `search_skills` — deterministic scored search for a capability or task.
- `recommend_skills` — proposes primary, complementary, and additional candidates while leaving the decision to the agent.
- `explain_skill` — returns metadata and duplicate locations for an exact skill name.

All tools are declared read-only and idempotent.

## Requirements

- Node.js 20 or newer.
- An MCP client with local stdio support, such as Cursor.

## Install

```bash
npm install -g https://github.com/Agent-Nova-107/skill-router-mcp/archive/refs/heads/main.tar.gz
```

Add the server to Cursor's user MCP configuration:

```json
{
  "mcpServers": {
    "skill-router": {
      "command": "skill-router-mcp"
    }
  }
}
```

Install the optional agent skill:

```bash
npx skills add Agent-Nova-107/skill-router-mcp --global --agent cursor --yes
```

Copy `cursor/skill-routing.mdc` to `~/.cursor/rules/skill-routing.mdc` if you want Cursor to consult the router automatically for ambiguous or complex tasks.

Restart Cursor after changing MCP configuration.

## Indexed locations

By default the server checks:

```text
~/.agents/skills/
~/.cursor/skills/
<current-directory>/.agents/skills/
<current-directory>/.cursor/skills/
```

Override this list with `SKILL_ROUTER_PATHS`, using the operating system's normal path separator (`;` on Windows, `:` on Unix):

```powershell
$env:SKILL_ROUTER_PATHS = "C:\skills;D:\team-skills"
```

Symbolic links are not followed. Skill files larger than 256 KiB and traversal deeper than eight directories are rejected.

## Routing model

Routing is deterministic:

1. Parse YAML frontmatter and invocation metadata.
2. Normalize English and French task terms.
3. Score name, description, workflow text, and lifecycle intent separately.
4. Collapse duplicate names while exposing every duplicate path.
5. Return a broad candidate pool divided into primary, complementary, and additional sections.

Scores rank candidates; they are not probabilities or quality ratings.

## Security and limitations

- Tools accept task text and skill names, not arbitrary filesystem paths.
- The server only reads the configured skill roots.
- Prompt text inside a skill is treated as searchable data, never executed.
- Keyword routing can miss semantic relationships or rank generic descriptions too highly.
- A recommendation proves relevance only, not quality, freshness, compatibility, or safety.
- The AI agent must inspect the task, codebase, and selected skill before acting.

## Development

```bash
npm ci
npm run check
npm test
npm run build
```

To smoke-test the stdio server with the MCP Inspector:

```bash
npx @modelcontextprotocol/inspector node dist/index.js
```

## License

MIT

TDQS

A3.6/5.0

Scored across 4 tools

Disambiguation3/5

Tools are mostly distinct in purpose: inventory summarizes the index, search finds candidates, recommend provides ranked suggestions, and explain returns metadata. However, search_skills and recommend_skills overlap notably in that both surface candidate skills for a task, with the difference (scored candidates vs. categorized recommendations) subtle enough that an agent could misselect. inventory_skills and explain_skill also both touch metadata/duplicate info.

Naming Consistency4/5

All four tools follow a consistent verb_noun pattern (inventory, search, recommend, explain) that is clear and readable. The verbs are varied but each communicates a distinct action well, and the noun 'skills' is consistent. Minor inconsistency: 'inventory' as a verb is slightly unconventional vs. the more standard 'list', but the pattern remains coherent.

Tool Count4/5

Four tools is a reasonable, focused count for a skill-routing server whose purpose is discovery/indexing/advisory. Each tool earns its place covering distinct stages of the workflow. Could arguably be slightly slim, but it's well-scoped and not overly heavy.

Completeness3/5

The surface covers indexing, searching, recommending, and explaining skills, which covers the core discovery workflow well. However, there's no tool for skill management operations (e.g., installing, removing, or updating skills), and no filter-by-category listing tool—gaps that agents might hit when they need to act on skills rather than just discover them. Still, for a routing/advisory purpose the surface is largely complete.

Maintenance

ActivitySlowing
ResponsivenessNo issues