mcp-on-demand-tools
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-on-demand-tools
A Model Context Protocol (MCP) server that enables dynamic tool registration and execution powered by AI agents. Register custom tools on-the-fly and have them simulated by Goose recipe-based agents.
Overview
This MCP server allows you to dynamically register new tools at runtime without server restarts. When you invoke a registered tool, the server uses a Goose recipe (render_template.yaml) to simulate the tool's execution and generate realistic output based on the tool's contract. This is useful for prototyping tool capabilities, testing workflows, or creating mock implementations before building real integrations.
Related MCP server: BYOB MCP Server
Components
Resources
The server provides resources for monitoring registered tools:
Tool definition resources (
tool://internal/{tool-name})Returns the complete tool schema including name, description, parameters, expected output, and side effects
Includes call count statistics for monitoring usage
Stats resource (
stats://internal/summary)Shows aggregate statistics: total tools registered, total calls made
Lists top 10 tools by call count
Prompts
plan-with-tools: A planning prompt that helps orchestrate tool usage
Arguments:
goal(required),notes(optional)Lists all currently registered tools and suggests registering new ones if needed
Tools
Core Tool
register-tool: Dynamically register a new on-demand tool
Required parameters:
name: Tool identifier (string)description: What the tool does (string)paramSchema: JSON object defining tool parameters. Each parameter should havedescriptionandtypeproperties. Can be provided as an object or JSON string.expectedOutput: Description of what the tool returns (string)sideEffects: Description of any side effects, e.g., "Makes API call to weather service" or "None - simulated data generation" (string)
Dynamic Tools
Once registered, tools become immediately available for invocation. Each registered tool:
Accepts a
paramsargument (object or JSON string)Executes via a Goose recipe (
render_template.yaml) which uses an AI model to generate realistic outputReturns simulated output matching the expected output contract
The server automatically notifies connected MCP clients when new tools are registered or when tool usage statistics change
How It Works
Register a tool using the
register-toolMCP tool with your desired schemaTool becomes available immediately - the server sends notifications to connected clients
Invoke the tool with specific parameter values
Goose recipe executes to simulate the tool and generate realistic output based on the contract
View statistics via resources to monitor tool usage and call history
Architecture
┌─────────────────┐
│ MCP Client │
│ (Goose, etc) │
└────────┬────────┘
│
│ register-tool
▼
┌─────────────────────────┐
│ MCP Server │
│ (mcp-on-demand-tools) │
│ │
│ • Stores tool metadata │
│ • Tracks call history │
│ • Provides resources │
└────────┬────────────────┘
│
│ invoke: tool-name(params)
▼
┌─────────────────────────┐
│ Goose Recipe Runner │
│ (render_template.yaml) │
│ │
│ Simulates tool based │
│ on contract & params │
└─────────────────────────┘Example Workflow
// Step 1: Register a weather forecast tool
{
"name": "get-weather-forecast",
"description": "Fetches weather forecast for a given location",
"paramSchema": {
"location": {
"description": "City name or coordinates",
"type": "string"
},
"days": {
"description": "Number of days to forecast (1-7)",
"type": "integer"
}
},
"expectedOutput": "Weather forecast data including temperature, conditions, and precipitation",
"sideEffects": "None - simulated data generation"
}
// Step 2: Tool is now available in MCP
// Step 3: Invoke it
{
"params": {
"location": "San Francisco",
"days": 3
}
}
// Step 4: Goose generates realistic weather data matching the contractInstallation
Prerequisites
Required:
Python 3.12 or higher
Goose - Must be installed and available in your PATH
uvpackage manager (recommended) orpip
Important: This server requires Goose to function. It uses Goose recipes to simulate tool execution, so you must have Goose installed before using this MCP server.
Compatibility Note: This server works best with MCP clients that support dynamic tool list updates (like Goose Desktop). Claude Code client does not automatically refresh the tool list when new tools are registered, so it may not work well with that client.
Installing the MCP Server
Add the server configuration to your config file:
Option 1: Use Published Package (Recommended)
{
"mcpServers": {
"mcp-on-demand-tools": {
"command": "uvx",
"args": ["mcp-on-demand-tools"]
}
}
}Option 2: Development Setup
Clone the repository and use local installation:
{
"mcpServers": {
"mcp-on-demand-tools": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp-on-demand-tools",
"run",
"mcp-on-demand-tools"
]
}
}
}Installing for Other MCP Clients
For other MCP-compatible clients, configure them to run:
uvx mcp-on-demand-toolsOr for development:
uv --directory /path/to/mcp-on-demand-tools run mcp-on-demand-toolsDevelopment
Setup
Clone the repository:
git clone https://github.com/yourusername/mcp-on-demand-tools.git
cd mcp-on-demand-toolsInstall dependencies:
uv syncRun locally:
uv run mcp-on-demand-toolsBuilding and Publishing
To prepare the package for distribution:
Build package distributions:
uv buildThis creates source and wheel distributions in the dist/ directory.
Publish to PyPI:
uv publishNote: Publishing requires PyPI credentials via environment variables or command flags:
Token:
--tokenorUV_PUBLISH_TOKENOr username/password:
--username/UV_PUBLISH_USERNAMEand--password/UV_PUBLISH_PASSWORD
Automated Publishing
The project includes a GitHub Actions workflow that automatically:
Builds the package on every push
Publishes to TestPyPI on pushes to
mainbranchPublishes to PyPI when you create a git tag (e.g.,
v0.1.0)
To publish a new version:
git tag v0.1.1
git push origin v0.1.1Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, use the MCP Inspector:
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-on-demand-tools run mcp-on-demand-toolsUpon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
Project Structure
mcp-on-demand-tools/
├── src/
│ └── mcp_on_demand_tools/
│ ├── __init__.py # Package entry point
│ ├── server.py # Main MCP server implementation
│ └── recipes/
│ └── render_template.yaml # Goose recipe for tool simulation
├── pyproject.toml # Project metadata and dependencies
├── uv.lock # Locked dependencies
└── README.md # This fileHow Tool Execution Works
When you invoke a registered tool:
The MCP server receives the tool call with parameters
It constructs a context string with:
Tool name and description
Expected output contract
Side effects declaration
Input parameters (as JSON)
Aggregate context: History of previous calls to this tool (if any)
The server executes
goose run --recipe render_template.yamlwith these parametersGoose's AI agent reads the contract and generates realistic output that matches the expected format
The output is extracted and returned to the MCP client
Stateful Tool Execution
New in v0.1.2: The server now maintains call history for each registered tool. When you invoke a tool multiple times, the AI agent receives context from previous calls, enabling:
Conversational tools: Tools can maintain context across multiple invocations
Incremental workflows: Each call can build upon previous results
State-aware responses: The AI can generate outputs that reference or continue from previous interactions
The aggregate context includes:
Total number of previous calls
Input parameters from each previous call
Exit codes and outputs (first 200 characters)
Call sequence/order
This allows the tool simulator to provide more coherent and contextual responses in multi-turn interactions.
Use Cases
This server is ideal for:
Rapid prototyping: Test tool concepts without implementing full functionality
API design exploration: Experiment with tool interfaces before committing to implementation
Workflow testing: Validate complex workflows with realistic mock data
Demonstration and documentation: Show how tools would work without building them
Placeholder tools: Create temporary tool implementations during development
Changelog
v0.1.1 (2025-10-12)
Added aggregate context support: Tool executions now receive history from previous calls
Enables stateful, conversational tool behavior across multiple invocations
AI agent can now generate contextually-aware responses based on call history
v0.1.0
Initial release
Initial MCP server implementation
Dynamic tool registration
Goose recipe-based tool simulation
License
See LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
AI-callable tools for API mocking, testing, monitoring, security, and automation.
Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
Email inboxes, webhooks, mock APIs, 2FA codes, approvals and 170 tools for AI agents.
Related MCP Servers
- AlicenseAqualityFmaintenanceEnables AI models to dynamically create and execute their own custom tools through a meta-function architecture, supporting JavaScript, Python, and Shell runtimes with sandboxed security and human approval flows.510MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to dynamically discover and invoke containerized tools that can be registered at runtime without redeployment. Built on Cloudflare Workers with scale-to-zero containers for secure, isolated tool execution.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to securely discover, invoke, and manage tools through a hardened MCP endpoint with protections like injection detection, circuit breakers, retry backoff, response caching, context-window limiting, and state snapshots.MIT
- FlicenseNot gradedqualityDmaintenanceEnables agents to securely discover and invoke a centrally governed catalog of tools from distributed internal and external providers, with policy enforcement, quotas, inspection, and audit controls.-