# MCP Server

Agent-native skill discovery via Model Context Protocol

The REST API works great for HTTP clients. But AI agents speak MCP — the Model Context Protocol. The `@skillkit/mcp` package lets agents discover skills natively, without HTTP calls or curl commands.

Think of it as giving your agent a direct line to the entire skill catalog.

## Setup

### Claude Desktop

Add this to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```
{
  "mcpServers": {
    "skillkit": {
      "command": "npx",
      "args": ["@skillkit/mcp"]
    }
  }
}
```

Restart Claude Desktop. Done.

### Cursor

Add to `.cursor/mcp.json` in your project:

```
{
  "mcpServers": {
    "skillkit": {
      "command": "npx",
      "args": ["@skillkit/mcp"]
    }
  }
}
```

### Any MCP client

The server uses stdio transport. Works with any MCP-compatible client:

```
npx @skillkit/mcp
```

## What your agent can do

Once connected, your agent gets four tools:

### Search skills

Ask your agent: _"Find skills for React performance optimization"_

Behind the scenes, it calls `search_skills` with your query and returns ranked results. You can filter by tags, category, or source repository.

```
> Search for authentication skills tagged with "security"
```

The agent searches across the full catalog, ranks results by relevance, and shows you the best matches.

### Get a specific skill

Ask: _"Get the pdf-processing skill from anthropics/skills"_

The agent calls `get_skill` and returns the full skill details — description, tags, content, and references.

### Get recommendations

Ask: _"What skills would you recommend for my TypeScript React project?"_

The agent calls `recommend_skills` with your stack context (languages, frameworks, libraries) and returns personalized suggestions ranked by relevance.

### Browse categories

Ask: _"What skill categories are available?"_

The agent calls `list_categories` and returns all categories with counts, so you know what's out there.

## Resources

The server also exposes two read-only resources:

- **`skills://trending`** — Top 20 skills by relevance score
- **`skills://categories`** — All categories with counts

Agents can read these without making a tool call.

## How it works

1. On startup, the server loads all skills from the marketplace catalog
2. Your agent sends a natural language request
3. The MCP client translates it into a tool call
4. The `RelevanceRanker` scores and ranks results (same algorithm as the REST API)
5. Results come back as structured JSON through the MCP protocol

Same ranking, same data, same quality — just native to your agent instead of going through HTTP.
