How to Build an MCP Server That Serves SKILL.md Skills
Build a Model Context Protocol server that serves SKILL.md skills to AI coding agents on demand.
MCP (Model Context Protocol) lets AI agents connect to external services and use them as tools. An MCP server that serves skills gives agents live access to a skill catalog — instead of downloading skills manually, the agent pulls the right skill automatically when it needs it.
This is how Agensi's one-liner curl install works. Here's how to build one yourself.
Quick Answer: An MCP skill server allows AI agents to dynamically search for and retrieve SKILL.md content at runtime instead of relying on manually downloaded files. It exposes
search_skillsandget_skilltools, facilitating on-demand access to a skill catalog.
What an MCP skill server does
A traditional skill workflow: developer downloads SKILL.md, puts it in a folder, agent reads it at startup.
An MCP skill server workflow: agent connects to MCP endpoint, searches for relevant skills at runtime, loads the skill content on demand. No downloads, no file management.
The MCP server exposes two main tools:
- search_skills — takes a natural language query, returns matching skills
- get_skill — takes a skill identifier, returns the full SKILL.md content
Recommended skills
skill-router-2
by Shippers · 4
Automatically detect, load, and stack the perfect skills combo for any user requ…

Solo SaaS Architect
by tudor.ai
Automatically builds complete, launch-ready SaaS websites, databases, and secure…

Dependency & Supply-Chain Risk Gate — Catch Vulnerable, Outdated & Typosquatted Packages Before They Ship
by PubsProToolkit
Audit your project's dependencies for supply-chain risk before they ship. Detect…
Basic architecture
Agent (Claude Code) → MCP Connection → Your Server → Skill Database
The agent connects via Server-Sent Events (SSE) or stdio. When the user asks for help with a task, the agent queries your server for matching skills, reads the SKILL.md content, and applies it to the current task.
Setting up the server
Using the MCP SDK for TypeScript:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
const server = new McpServer({
name: "skill-server",
version: "1.0.0"
});
// Tool: search for skills
server.tool("search_skills", {
description: "Search for SKILL.md skills by task description",
inputSchema: {
type: "object",
properties: {
query: { type: "string", description: "What task do you need help with?" }
},
required: ["query"]
}
}, async ({ query }) => {
const results = await searchSkills(query);
return {
content: [{ type: "text", text: JSON.stringify(results) }]
};
});
// Tool: get full skill content
server.tool("get_skill", {
description: "Get the full SKILL.md content for a specific skill",
inputSchema: {
type: "object",
properties: {
skill_id: { type: "string", description: "Skill identifier" }
},
required: ["skill_id"]
}
}, async ({ skill_id }) => {
const content = await getSkillContent(skill_id);
return {
content: [{ type: "text", text: content }]
};
});
Skill search implementation
The search tool needs to match natural language queries to skills. Options from simplest to most sophisticated:
Keyword matching: Search skill names and descriptions for query terms. Fast, simple, but misses semantic matches.
Embedding search: Generate vector embeddings of skill descriptions. Store in a vector database (pgvector, Pinecone, Qdrant). Find nearest neighbors to the query embedding. Catches semantic matches — "fix my tests" matches a skill described as "generates test files for uncovered functions."
Hybrid: Keyword search for exact matches, embedding search for semantic matches, combine and rank results.
Deployment
MCP servers can be deployed as:
- Cloud function (Netlify Edge, Vercel, AWS Lambda) — scales to zero, cheap
- Dedicated server — more control, needed for persistent connections
- Local process — for personal/development use
The server URL gets added to the agent's MCP configuration:
{
"mcpServers": {
"skill-server": {
"url": "https://your-server.com/mcp"
}
}
}
Connecting to Agensi's catalog
Instead of building your own skill database, you can proxy to Agensi's catalog API. Agensi's public catalog API already serves the full marketplace catalog. Pro subscribers get live access to all skill content.
If you're building a custom server for your team, you might combine your private internal skills with Agensi's public catalog — search your team's skills first, fall back to the marketplace for skills you don't have internally.
Connect to the Agensi skill catalog via MCP at Agensi's one-liner curl install.
Keep reading
- Claude Code Skills Not Working? Troubleshooting Guide
- AI Agent Security: How to Audit Skills and MCP Servers Before Installing (2026)
- Using Claude Code for DevOps Automation: Complete Guide (2026)
- How to Customize Your AI Coding Agent: Complete Guide (2026)
- Context Engineering for AI Agents: What It Is and Why It Changes Everything