Custom Agent / SDK Quick Start
Building your own MCP client? Connect to ToolPilot programmatically using the official TypeScript or Python SDK.
Prerequisites
- Node.js 18+ (for the ToolPilot MCP server and TypeScript SDK)
- TypeScript:
npm install @modelcontextprotocol/sdk - Python:
pip install mcp
Step 1: Connect to ToolPilot
Use the MCP SDK to spin up the ToolPilot server and connect via stdio transport:
Transport options
The example above uses stdio transport (recommended for local development). ToolPilot also supports SSE transport for remote connections.
Step 2: Search for Tools
Call search_tools with a natural-language query. ToolPilot may return clarification questions โ answer them with search_tools_respond to refine results.
clarification-flow.ts
1// Handle clarification if needed
2const searchResult = await client.callTool('search_tools', {
3 query: 'lightweight container orchestration for small teams',
4});
5
6// If result contains a clarification question:
7const refined = await client.callTool('search_tools_respond', {
8 session_id: searchResult.session_id,
9 answer: 'We need something simpler than Kubernetes, max 10 nodes',
10});
Step 3: Explore Available MCP Tools
ToolPilot exposes 5 MCP tools for different stages of tool discovery:
search_toolsSearch the tool graph with a natural-language query. Returns ranked results with health scores.search_tools_respondAnswer a clarification question to refine search results.get_stackBuild a compatible tool stack for a given use case (e.g., "full-stack web app").check_issueDiagnose issues with a specific tool โ check health, known problems, and alternatives.report_outcomeReport whether a recommended tool worked, improving future results.See the MCP Tools Reference for complete parameter documentation and response schemas.
Step 4: Report Outcomes
Close the feedback loop by reporting which tools worked:
Outcomes improve the graph
Every outcome report adjusts edge weights in the tool graph. This is what makes ToolPilot's recommendations improve over time โ please integrate outcome reporting into your agent's workflow.