소스 정보
- 저장소
- vinilana/dotcontext
- 최근 소스 활동
- 2026년 3월 22일 00:29
- 감지된 SKILL.md 언어
- 영어
- 스타
- 557
- 포크
- 93
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/vinilana/dotcontext --skill mcp-tool-design명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Implement or review bounded MCP inputs and responses. Use for gateway response helpers, MCP Zod schemas, list actions, cursor pagination, maxEvents, JSON serialization, audit logging, response metadata, artifact exports, or payload-size and client-compatibility changes.
Implement or review child-process execution with bounded stdout and stderr memory. Use for Node spawn wrappers, sensors, test runners, acceptance commands, timeout handling, output tails, truncation, or any change that captures subprocess output in the dotcontext harness.
Design, implement, or review bounded cache and persistent-index lifecycle. Use for ContextCache, SemanticContextBuilder, tree-sitter analysis cache, MCP session cache, hook host-session bindings, checkpoints, TTL, LRU, byte budgets, invalidation, cleanup timers, disposal, migration, or runtime retention configuration.
SOC 직업 분류 기준
SKILL.md 표시 중
| type | skill |
| name | MCP Tool Design |
| description | Design MCP tools and gateway interfaces for the dotcontext server |
| skillSlug | api-design |
| phases | ["P","R"] |
| generated | "2026-03-18T00:00:00.000Z" |
| status | filled |
| scaffoldVersion | 2.0.0 |
Guidance for designing and extending MCP (Model Context Protocol) tools exposed by AIContextMCPServer in src/services/mcp/mcpServer.ts.
context://, file://, workflow://)src/services/mcp/gateway/The MCP server follows a consolidated gateway pattern to minimize cognitive load for AI agents:
AIContextMCPServer (mcpServer.ts)
registerGatewayTools()
-> explore (read, list, analyze, search, getStructure)
-> context (check, init, fill, fillSingle, listToFill, getMap, buildSemantic, scaffoldPlan)
-> sync (exportRules, exportDocs, exportAgents, exportContext, exportSkills, reverseSync, importDocs, importAgents, importSkills)
-> plan (link, getLinked, getDetails, getForPhase, updatePhase, recordDecision, updateStep, getStatus, syncMarkdown, commitPhase)
-> agent (discover, getInfo, orchestrate, getSequence, getDocs, getPhaseDocs, listTypes)
-> skill (list, getContent, getForPhase, scaffold, export, fill)
-> workflow-init / workflow-status / workflow-advance / workflow-manage
Each gateway dispatches to a handler in src/services/mcp/gateway/<name>.ts. The handler receives typed params and an options object with repoPath.
z.enum([...]) and extend the handler switch.workflow-* was split out for clarity).All MCP tool inputs use Zod v4 schemas (imported from zod). Follow the existing pattern:
inputSchema: {
action: z.enum(['existingAction', 'newAction'])
.describe('Action to perform'),
newParam: z.string().optional()
.describe('(newAction) What this param does'),
}
Key conventions:
.describe() with the action prefix in parentheses: (actionName)z.enum() for constrained values, z.array(z.string()) for lists.optional() since different actions use different params../../workflow (e.g., PREVC_ROLES, AGENT_TYPES)Add a new file in src/services/mcp/gateway/ or extend an existing one:
// src/services/mcp/gateway/myGateway.ts
import { createJsonResponse, createErrorResponse, type MCPToolResponse } from './response';
export type MyAction = 'doThing' | 'doOther';
export interface MyParams {
action: MyAction;
repoPath?: string;
// action-specific params
}
export interface MyOptions {
repoPath: string;
}
export async function handleMy(params: MyParams, options: MyOptions): Promise<MCPToolResponse> {
switch (params.action) {
case 'doThing':
return createJsonResponse({ success: true, message: 'Done' });
default:
return createErrorResponse(`Unknown action: ${params.action}`);
}
}
Use the three helpers from src/services/mcp/gateway/response.ts:
createJsonResponse(data) -- structured JSON for programmatic consumptioncreateErrorResponse(message) -- sets isError: truecreateTextResponse(text) -- plain text for human-readable outputAll responses conform to MCPToolResponse with content: [{ type: 'text', text }].
Register the tool in registerGatewayTools() using the wrap() helper for automatic action logging:
this.server.registerTool('my-tool', {
description: `Description with action list...`,
inputSchema: { /* Zod schemas */ }
}, wrap('my-tool', async (params): Promise<MCPToolResponse> => {
return handleMy(params as MyParams, { repoPath: this.getRepoPath() });
}));
Add your handler, types, and params to the re-export barrel in src/services/mcp/gatewayTools.ts and src/services/mcp/gateway/index.ts.
Write tests in src/services/mcp/ following the pattern in mcpServer.test.ts. Since MCP tools require stdio transport, test the handler functions directly:
import { handleMy } from './gateway/myGateway';
it('should handle doThing action', async () => {
const result = await handleMy(
{ action: 'doThing' },
{ repoPath: tempDir }
);
const payload = JSON.parse(result.content[0].text);
expect(payload.success).toBe(true);
});
getStatus, buildSemantic, exportRules).describe() annotations with action prefixMCPToolResponse via response helpersrepoPath resolution uses this.getRepoPath(params.repoPath) for cachingwrap() helperprocess.cwd() directly in handlers; always use the repoPath from options.optional() and validate inside the handlercreateErrorResponse() for consistent error shapeprocess.stderr.write() to avoid corrupting the MCP protocol