Infinite Skills, Finite Context: Introducing
The missing piece in your AI agent toolkit has arrived.
If you have ever built an AI agent, you know the struggle: your agent needs access to dozens of tools, but every tool description you add consumes part of the context window. You are forced to choose between breadth, with many tools, and depth, with detailed instructions.
What if you did not have to choose?
Enter skills.rs, a unified MCP server designed to reduce context-window consumption while enabling on-demand tool discovery for AI agents.
The Problem: Context Window Bankruptcy#
Modern AI agents operate through the Model Context Protocol, or MCP, connecting to servers that provide tools such as web search, file operations, database queries, and more.
The standard workflow looks like this:
- Load all available tools into context.
- The agent reviews hundreds of lines of tool descriptions.
- The agent selects the relevant tool.
- Much of the context window has already been consumed by tool metadata.
This approach does not scale. As more capabilities are added, the context limit is reached quickly. The agent may spend more tokens examining tools than solving the actual problem.
Illustrative metrics:
- A typical MCP setup with 10–20 tools may require 2,000–5,000 tokens for tool descriptions.
- With more than 50 tools, tool metadata can consume a substantial part of the context before task execution begins.
- The result may be slower, more expensive, and less capable agent behaviour.
The Solution: Progressive Disclosure#
skills.rs uses a progressive-disclosure approach: expose seven focused meta-tools instead of hundreds of individual tools.
Rather than loading every tool description into context, agents can:
- Search for tools on demand using
skills.search. - Inspect only the required tools using
skills.schema. - Execute tools with validation and sandboxing using
skills.exec.
The project is designed to reduce tool-metadata overhead while allowing agents to discover a large number of tools dynamically.
How It Works#
Traditional Approach:
┌────────────────────────────────────────┐
│ Agent Context (8K tokens) │
│ │
│ ┌────────────────────────────────────┐ │
│ │ Tool 1: read_file (80 tokens) │ │
│ │ Tool 2: write_file (90 tokens) │ │
│ │ Tool 3: brave_search (120 tokens) │ │
│ │ Tool 4: sql_query (150 tokens) │ │
│ │ ... 50 more tools ... │ │
│ │ 5,000+ tokens consumed │ │
│ └────────────────────────────────────┘ │
│ │
│ Task: "Search for latest AI news" │
│ Only 3K tokens remaining │
└────────────────────────────────────────┘
skills.rs Approach:
┌────────────────────────────────────────┐
│ Agent Context (8K tokens) │
│ │
│ ┌────────────────────────────────────┐ │
│ │ Seven meta-tools │ │
│ │ │ │
│ │ - skills.search │ │
│ │ - skills.schema │ │
│ │ - skills.exec │ │
│ │ - skills.create │ │
│ │ - skills.get_content │ │
│ │ - skills.update │ │
│ │ - skills.delete │ │
│ └────────────────────────────────────┘ │
│ │
│ Task: "Search for latest AI news" │
│ Most of the context remains available │
└────────────────────────────────────────┘
Two Modes of Operation#
skills.rs supports both MCP server mode and CLI mode.
Mode 1: MCP Server with Progressive Disclosure#
Run skills.rs as an MCP server that aggregates multiple upstream servers and exposes seven focused meta-tools:
skills stdio
An AI agent connects through MCP and uses progressive disclosure.
Step 1: Search for tools#
{
"tool": "skills.search",
"args": {
"q": "search web",
"kind": "tool",
"limit": 5
}
}
This returns a small set of matching tools with minimal metadata.
Step 2: Retrieve the schema for the selected tool#
{
"tool": "skills.schema",
"args": {
"id": "tool://brave_search@1.0"
}
}
This returns the full JSON schema only for the selected tool.
Step 3: Execute the tool#
{
"tool": "skills.exec",
"args": {
"id": "tool://brave_search@1.0",
"arguments": {
"query": "latest AI news"
}
}
}
Mode 2: CLI Agent Interface#
skills.rs also includes a CLI intended to provide functionality similar to mcp-cli, together with additional execution and skills-management features.
# List all servers and tools
skills list
# Search for specific tools
skills grep "file"
# Get a tool schema
skills tool filesystem/read_file
# Execute a tool
skills tool filesystem/read_file '{"path": "./README.md"}'
Feature Comparison#
Feature
mcp-cli
skills.rs
Token reduction
✓
✓
CLI interface
✓
✓
Execution persistence
✗
✓
Sandboxed execution
✗
✓
Skills system
✗
✓
Can run as an MCP server
✗
✓
Audit logging
✗
✓
The Skills System: Teaching Agents New Workflows#
Beyond tool aggregation, skills.rs introduces a skills system: reusable packages of instructions, metadata, tools, scripts, and support files that agents can load on demand.
What Is a Skill?#
A skill is a directory containing:
skill.json: a manifest defining inputs, outputs, policies, and metadata.SKILL.md: natural-language instructions for the agent.- Optional bundled scripts written in Python, Bash, or another supported language.
- Support files such as data, schemas, and documentation.
Example: Web Researcher Skill#
skills/web-researcher/
├── skill.json
├── SKILL.md
├── search.py
└── search.py.schema.json
skill.json#
{
"id": "web-researcher",
"version": "1.0.0",
"description": "Research topics using web search",
"inputs": {
"type": "object",
"properties": {
"query": {
"type": "string"
}
}
},
"entrypoint": "prompted",
"tool_policy": {
"allow": [
"brave_search"
]
}
}
SKILL.md#
# Web Researcher
## Purpose
Research topics comprehensively using web search.
## Instructions
1. Use `brave_search` to find relevant articles.
2. Read the top three results.
3. Synthesize the findings into a summary.
4. Save the summary to a Markdown file.
## Expected Output
A Markdown file containing a summary of the researched topic.
Progressive Skill Loading#
Skills use the same progressive-disclosure pattern:
- Level 1: Load only metadata such as the name, description, and tags.
- Level 2: Load the full
SKILL.mdinstructions on demand. - Level 3: Load bundled scripts when required.
- Level 4: Execute with validation and sandboxing.
This design allows an agent to access many skills while consuming relatively little context until detailed instructions or executable resources are required.
Production Security#
skills.rs includes multiple execution-isolation and auditing features intended for production-oriented deployments.
Multi-Backend Sandboxing#
Backend
Security Level
Platform
Intended Use
timeout
Basic
All platforms
Development
restricted
Medium
Unix
Resource-limited execution
bubblewrap
High
Linux
Process and filesystem isolation
wasm
High
All platforms
Future WebAssembly runtime
Security Features#
- Resource limits: Configurable CPU, memory, and file-descriptor limits.
- Timeout enforcement: Stops long-running or unresponsive scripts.
- Path-traversal protection: Validates file paths before access.
- Network isolation: Supports optional network blocking.
- Environment sanitization: Removes potentially dangerous environment variables.
- Execution auditing: Stores an execution trail in SQLite.
- Input validation: Validates inputs against JSON Schema definitions.
Example Production Configuration#
sandbox:
backend: bubblewrap
timeout_ms: 30000
max_memory_bytes: 536870912 # 512 MB
max_cpu_seconds: 30
allow_network: false
persistence:
enabled: true
database: "./data/skills.db"
prune_after_days: 30
Built with Rust#
skills.rs is implemented in Rust and is designed for low-overhead search, lookup, loading, execution, and persistence operations.
Operation
Reported Time
Implementation
Skill search
<10 ms
Tantivy full-text index
Registry lookup
<1 ms
HashMap-based lookup
Content loading
~1 ms
Single-file read
Bundled tool execution
50–200 ms
Interpreter startup
Persistence save
~2 ms
SQLite insert
Reported Scale Tests#
- 100 skills with no reported degradation.
- 1,000 callables with lookup times below 1 ms.
- 10,000 execution records with query times below 10 ms.
Getting Started#
Install#
# Install from crates.io
cargo install skillsrs
# Install from GitHub
cargo install --git https://github.com/labiium/skills
# Build from source
git clone https://github.com/labiium/skills
cd skills
cargo build --release
Configure#
Create the following file:
~/.config/skills/config.yaml
Example configuration:
server:
transport: stdio
log_level: info
sandbox:
backend: timeout
timeout_ms: 30000
upstreams:
- alias: brave
transport: stdio
command:
- npx
- -y
- "@modelcontextprotocol/server-brave-search"
Run#
# Run as an MCP server
skills stdio
# Use as a CLI
skills list
skills grep "search"
skills tool brave/search '{"query": "rust MCP"}'
Use Cases#
1. Multi-Tool AI Agents#
Problem: An agent needs access to more than 50 tools across multiple MCP servers.
Solution: skills.rs aggregates upstream servers behind one interface and allows the agent to discover tools progressively.
upstreams:
- alias: filesystem
command:
- mcp-server-filesystem
- alias: brave
command:
- mcp-server-brave-search
- alias: database
command:
- mcp-server-postgres
- alias: git
command:
- mcp-server-git
The agent can access tools from all configured upstream servers without loading every complete schema into its initial context.
2. Reusable Agent Workflows#
Problem: A complex agent workflow has been developed, but there is no efficient way to reuse it.
Solution: Package the workflow as a skill that compatible agents can load on demand.
skills create \
--name code-reviewer \
--description "Review code changes for bugs and style issues" \
--entrypoint prompted
3. Secure Code Execution#
Problem: An agent needs to execute user-provided code, but that code cannot be trusted.
Solution: Configure sandboxed execution with resource limits and optional network isolation.
sandbox:
backend: bubblewrap
max_memory_bytes: 536870912
max_cpu_seconds: 10
allow_network: false
4. Team Skill Libraries#
Problem: A team has created many custom tools and workflows but lacks a centralized way to share them.
Solution: Maintain a shared skills repository that multiple agents can access.
skills/
├── data-analysis/
├── code-generation/
├── documentation/
├── testing/
└── deployment/
Why#
skills.rsMatters
The Model Context Protocol provides a common way for AI agents to access tools and data. As the number of available tools increases, agents face a tool-sprawl problem: static loading of every tool description becomes increasingly expensive in context tokens.
skills.rs introduces a meta-layer that separates discovery, schema retrieval, and execution.
This architecture supports:
- Agents with access to large tool registries without loading every schema initially.
- Dynamic tool discovery rather than entirely static tool configuration.
- Reusable skills that can be loaded on demand.
- Sandboxed execution and audit logging.
- A Rust implementation designed for relatively low execution overhead.
Get Started#
skills.rs is released under the Apache 2.0 licence.
Resources#
- Repository: github.com/labiium/skills
- Documentation: Available in the repository
- Installation:
cargo install skillsrs
Contributing#
Contributions can be submitted through:
- GitHub Issues
- GitHub Discussions
- Pull requests
The Future Is Modular#
AI agents increasingly need access to larger collections of tools, instructions, and workflows. A progressive-disclosure architecture allows those capabilities to remain discoverable without placing every definition into the initial context.
skills.rs applies this approach to MCP tools and reusable agent skills.
Progressive disclosure can reduce context overhead while preserving access to a broad capability set.
To install and start the MCP server:
cargo install skillsrs
skills stdio