[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NNDMX97V4ES3CHDZEKW8RV":3,"skill-same:01M6NNDMX97V4ES3CHDZEKW8RV":69},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":6,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":54,"install":55,"resources":68},"01M6NNDMX97V4ES3CHDZEKW8RV","mcp-server",null,"Model Context Protocol server development patterns. Use when building custom MCP servers, exposing tools and resources, handling JSON-RPC, implementing credential isolation, or integrating with Claude Desktop, Cursor, or AI agents. Covers @modelcontextprotocol\u002Fsdk, StdioServerTransport, tool schemas, and multi-tenant credential patterns.","revealui-studio\u002Frevskills","revealui-studio","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F338824821?v=4","01M6NNBRBPN7P6MK70FZQZ5RAQ","01M6NNBRG527YFDFHNYKTCDA4Y",2,"MIT","https:\u002F\u002Fgithub.com\u002Frevealui-studio\u002Frevskills\u002Fblob\u002Ftest\u002Fskills\u002Fmcp-server\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"mcp server","server","MCP","read","custom","tenant","implementing","studio","resources","isolation","patterns","use","context","model","tool","Tools","rpc","development","model context protocol","ai agents","2026-11-10 10:12:30",false,"---\nname: mcp-server\ndescription: Model Context Protocol server development patterns. Use when building custom MCP servers, exposing tools and resources, handling JSON-RPC, implementing credential isolation, or integrating with Claude Desktop, Cursor, or AI agents. Covers @modelcontextprotocol\u002Fsdk, StdioServerTransport, tool schemas, and multi-tenant credential patterns.\nlicense: MIT\nallowed-tools: Read, Grep, Glob\nmetadata:\n  author: RevealUI Studio\n  version: \"0.1.0\"\n  website: https:\u002F\u002Frevealui.com\n---\n\n# MCP Server Development\n\n## Server Scaffolding\n\n```typescript\nimport { Server } from '@modelcontextprotocol\u002Fsdk\u002Fserver\u002Findex.js';\nimport { StdioServerTransport } from '@modelcontextprotocol\u002Fsdk\u002Fserver\u002Fstdio.js';\nimport {\n  type CallToolRequest,\n  CallToolRequestSchema,\n  ListToolsRequestSchema,\n  type Tool,\n} from '@modelcontextprotocol\u002Fsdk\u002Ftypes.js';\n\nconst server = new Server(\n  { name: 'my-server', version: '0.1.0' },\n  { capabilities: { tools: {} } },\n);\n```\n\n## Tool Definition\n\nTools use JSON Schema for input validation:\n\n```typescript\nconst TOOLS: Tool[] = [\n  {\n    name: 'my_tool',\n    description: 'What this tool does and when to use it.',\n    inputSchema: {\n      type: 'object',\n      properties: {\n        query: { type: 'string', description: 'Search query' },\n        limit: { type: 'number', description: 'Max results (default: 10)', default: 10 },\n        filters: {\n          type: 'object',\n          description: 'Optional filters',\n          properties: {\n            status: { type: 'string', enum: ['active', 'archived'] },\n          },\n        },\n      },\n      required: ['query'],\n    },\n  },\n];\n\nserver.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));\n```\n\n## Tool Dispatch\n\n```typescript\nserver.setRequestHandler(CallToolRequestSchema, async (request: CallToolRequest) => {\n  const startTime = Date.now();\n  const toolName = request.params.name;\n\n  try {\n    let data: unknown;\n\n    switch (toolName) {\n      case 'my_tool': {\n        const { query, limit = 10 } = request.params.arguments as {\n          query: string;\n          limit?: number;\n        };\n        data = await myApiCall(query, limit);\n        break;\n      }\n\n      default:\n        return {\n          content: [{ type: 'text', text: `Error: Unknown tool: ${toolName}` }],\n          isError: true,\n        };\n    }\n\n    return {\n      content: [{\n        type: 'text',\n        text: JSON.stringify({\n          data,\n          _meta: {\n            durationMs: Date.now() - startTime,\n            server: 'my-server',\n            tool: toolName,\n            timestamp: new Date().toISOString(),\n          },\n        }, null, 2),\n      }],\n    };\n  } catch (err) {\n    return {\n      content: [{\n        type: 'text',\n        text: `Error: ${err instanceof Error ? err.message : String(err)}`,\n      }],\n      isError: true,\n    };\n  }\n});\n```\n\n## Server Startup\n\n```typescript\nasync function main() {\n  const transport = new StdioServerTransport();\n  await server.connect(transport);\n}\n\nmain().catch((err) => {\n  console.error('MCP server error:', err);\n  process.exit(1);\n});\n```\n\n## Credential Isolation\n\nFor multi-tenant servers, use a credential override pattern:\n\n```typescript\nlet _credentialOverrides: Record\u003Cstring, string> = {};\n\nexport async function withTenantCredentials\u003CT>(\n  creds: Record\u003Cstring, string>,\n  fn: () => Promise\u003CT>,\n): Promise\u003CT> {\n  _credentialOverrides = { ...creds };\n  try {\n    return await fn();\n  } finally {\n    _credentialOverrides = {};\n  }\n}\n\n\u002F\u002F In tool handler, only the credentials for this invocation are visible.\n\u002F\u002F A missing withTenantCredentials call must not reuse the previous tenant.\nconst apiKey = _credentialOverrides.API_KEY ?? process.env.API_KEY;\nif (!apiKey) {\n  return { content: [{ type: 'text', text: 'Error: API_KEY not set' }], isError: true };\n}\n```\n\nThe hypervisor wraps each invocation in `withTenantCredentials`. The `finally` clears the override so the next invocation cannot read the previous tenant key.\n\n## HTTP API Helper Pattern\n\n```typescript\nfunction authHeaders(token: string): Record\u003Cstring, string> {\n  return {\n    Authorization: `Bearer ${token}`,\n    'Content-Type': 'application\u002Fjson',\n    'User-Agent': 'MyServer-MCP\u002F0.1.0',\n  };\n}\n\nasync function apiPost(path: string, body: Record\u003Cstring, unknown>): Promise\u003Cunknown> {\n  const { apiUrl, token } = getConfig();\n  const res = await fetch(`${apiUrl}${path}`, {\n    method: 'POST',\n    headers: authHeaders(token),\n    body: JSON.stringify(body),\n  });\n  const data = await res.json();\n  if (!res.ok) throw new Error(data.error ?? `API error ${res.status}`);\n  return data;\n}\n```\n\n## Hypervisor Registration\n\n```typescript\nhypervisor.registerServer({\n  name: 'my-server',\n  command: 'node',\n  args: ['dist\u002Fservers\u002Fmy-server.js'],\n  env: { API_KEY: 'resolved-at-spawn' },\n  requiredTier: 'pro',\n});\n```\n\n## Claude Desktop Configuration\n\n```json\n{\n  \"mcpServers\": {\n    \"my-server\": {\n      \"command\": \"node\",\n      \"args\": [\"\u002Fpath\u002Fto\u002Fdist\u002Fservers\u002Fmy-server.js\"],\n      \"env\": {\n        \"API_KEY\": \"your-api-key\"\n      }\n    }\n  }\n}\n```\n\n## Response Format\n\nAlways return `content` array with `type: 'text'`:\n\n```typescript\n\u002F\u002F Success\nreturn {\n  content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],\n};\n\n\u002F\u002F Error\nreturn {\n  content: [{ type: 'text', text: `Error: ${message}` }],\n  isError: true,\n};\n```\n\n## Best Practices\n\n- Validate all inputs before API calls\n- Include `_meta` with duration, server name, tool name, timestamp\n- Use descriptive tool names with a namespace prefix (e.g., `stripe_`, `memory_`)\n- Keep tool descriptions actionable: what it does, when to use it\n- Set `required` only for truly required fields; use defaults for optional\n- Handle timeouts gracefully (AbortController with 10-30s limits)\n- Log errors server-side but return clean error messages to clients\n","# MCP Server Development\n\n## Server Scaffolding\n\n```typescript\nimport { Server } from '@modelcontextprotocol\u002Fsdk\u002Fserver\u002Findex.js';\nimport { StdioServerTransport } from '@modelcontextprotocol\u002Fsdk\u002Fserver\u002Fstdio.js';\nimport {\n  type CallToolRequest,\n  CallToolRequestSchema,\n  ListToolsRequestSchema,\n  type Tool,\n} from '@modelcontextprotocol\u002Fsdk\u002Ftypes.js';\n\nconst server = new Server(\n  { name: 'my-server', version: '0.1.0' },\n  { capabilities: { tools: {} } },\n);\n```\n\n## Tool Definition\n\nTools use JSON Schema for input validation:\n\n```typescript\nconst TOOLS: Tool[] = [\n  {\n    name: 'my_tool',\n    description: 'What this tool does and when to use it.',\n    inputSchema: {\n      type: 'object',\n      properties: {\n        query: { type: 'string', description: 'Search query' },\n        limit: { type: 'number', description: 'Max results (default: 10)', default: 10 },\n        filters: {\n          type: 'object',\n          description: 'Optional filters',\n          properties: {\n            status: { type: 'string', enum: ['active', 'archived'] },\n          },\n        },\n      },\n      required: ['query'],\n    },\n  },\n];\n\nserver.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));\n```\n\n## Tool Dispatch\n\n```typescript\nserver.setRequestHandler(CallToolRequestSchema, async (request: CallToolRequest) => {\n  const startTime = Date.now();\n  const toolName = request.params.name;\n\n  try {\n    let data: unknown;\n\n    switch (toolName) {\n      case 'my_tool': {\n        const { query, limit = 10 } = request.params.arguments as {\n          query: string;\n          limit?: number;\n        };\n        data = await myApiCall(query, limit);\n        break;\n      }\n\n      default:\n        return {\n          content: [{ type: 'text', text: `Error: Unknown tool: ${toolName}` }],\n          isError: true,\n        };\n    }\n\n    return {\n      content: [{\n        type: 'text',\n        text: JSON.stringify({\n          data,\n          _meta: {\n            durationMs: Date.now() - startTime,\n            server: 'my-server',\n            tool: toolName,\n            timestamp: new Date().toISOString(),\n          },\n        }, null, 2),\n      }],\n    };\n  } catch (err) {\n    return {\n      content: [{\n        type: 'text',\n        text: `Error: ${err instanceof Error ? err.message : String(err)}`,\n      }],\n      isError: true,\n    };\n  }\n});\n```\n\n## Server Startup\n\n```typescript\nasync function main() {\n  const transport = new StdioServerTransport();\n  await server.connect(transport);\n}\n\nmain().catch((err) => {\n  console.error('MCP server error:', err);\n  process.exit(1);\n});\n```\n\n## Credential Isolation\n\nFor multi-tenant servers, use a credential override pattern:\n\n```typescript\nlet _credentialOverrides: Record\u003Cstring, string> = {};\n\nexport async function withTenantCredentials\u003CT>(\n  creds: Record\u003Cstring, string>,\n  fn: () => Promise\u003CT>,\n): Promise\u003CT> {\n  _credentialOverrides = { ...creds };\n  try {\n    return await fn();\n  } finally {\n    _credentialOverrides = {};\n  }\n}\n\n\u002F\u002F In tool handler, only the credentials for this invocation are visible.\n\u002F\u002F A missing withTenantCredentials call must not reuse the previous tenant.\nconst apiKey = _credentialOverrides.API_KEY ?? process.env.API_KEY;\nif (!apiKey) {\n  return { content: [{ type: 'text', text: 'Error: API_KEY not set' }], isError: true };\n}\n```\n\nThe hypervisor wraps each invocation in `withTenantCredentials`. The `finally` clears the override so the next invocation cannot read the previous tenant key.\n\n## HTTP API Helper Pattern\n\n```typescript\nfunction authHeaders(token: string): Record\u003Cstring, string> {\n  return {\n    Authorization: `Bearer ${token}`,\n    'Content-Type': 'application\u002Fjson',\n    'User-Agent': 'MyServer-MCP\u002F0.1.0',\n  };\n}\n\nasync function apiPost(path: string, body: Record\u003Cstring, unknown>): Promise\u003Cunknown> {\n  const { apiUrl, token } = getConfig();\n  const res = await fetch(`${apiUrl}${path}`, {\n    method: 'POST',\n    headers: authHeaders(token),\n    body: JSON.stringify(body),\n  });\n  const data = await res.json();\n  if (!res.ok) throw new Error(data.error ?? `API error ${res.status}`);\n  return data;\n}\n```\n\n## Hypervisor Registration\n\n```typescript\nhypervisor.registerServer({\n  name: 'my-server',\n  command: 'node',\n  args: ['dist\u002Fservers\u002Fmy-server.js'],\n  env: { API_KEY: 'resolved-at-spawn' },\n  requiredTier: 'pro',\n});\n```\n\n## Claude Desktop Configuration\n\n```json\n{\n  \"mcpServers\": {\n    \"my-server\": {\n      \"command\": \"node\",\n      \"args\": [\"\u002Fpath\u002Fto\u002Fdist\u002Fservers\u002Fmy-server.js\"],\n      \"env\": {\n        \"API_KEY\": \"your-api-key\"\n      }\n    }\n  }\n}\n```\n\n## Response Format\n\nAlways return `content` array with `type: 'text'`:\n\n```typescript\n\u002F\u002F Success\nreturn {\n  content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],\n};\n\n\u002F\u002F Error\nreturn {\n  content: [{ type: 'text', text: `Error: ${message}` }],\n  isError: true,\n};\n```\n\n## Best Practices\n\n- Validate all inputs before API calls\n- Include `_meta` with duration, server name, tool name, timestamp\n- Use descriptive tool names with a namespace prefix (e.g., `stripe_`, `memory_`)\n- Keep tool descriptions actionable: what it does, when to use it\n- Set `required` only for truly required fields; use defaults for optional\n- Handle timeouts gracefully (AbortController with 10-30s limits)\n- Log errors server-side but return clean error messages to clients\n",{"name":5,"license":14,"metadata":43,"description":7,"allowed-tools":47},{"author":44,"version":45,"website":46},"RevealUI Studio","0.1.0","https:\u002F\u002Frevealui.com","Read, Grep, Glob","test","2b46ce0cfb27f77a7b78cfb49b0b004e2072b7ba","skills\u002Fmcp-server",0,"https:\u002F\u002Fgithub.com\u002Frevealui-studio\u002Frevskills","https:\u002F\u002Fgithub.com\u002Frevealui-studio","2026-11-11 23:29:48",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add revealui-studio\u002Frevskills --skill mcp-server",{"tool":61,"command":62},"bunx","bunx skills add revealui-studio\u002Frevskills --skill mcp-server",{"tool":64,"command":65},"pnpm","pnpm dlx skills add revealui-studio\u002Frevskills --skill mcp-server","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frevealui-studio\u002Frevskills\u002Fblob\u002Ftest\u002Fskills\u002Fmcp-server\u002FSKILL.md",true,[],[70,91,102,115,138,163],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":38},"01M6NNN0QCBBPEW3V3C4SBETRZ","good-skill","A minimal valid skill fixture used to prove the skills-lint and plugin-lint validators accept well formed input. Covers frontmatter shape only.","https:\u002F\u002Fgithub.com\u002Frevealui-studio\u002Frevskills\u002Fblob\u002Ftest\u002Ftest\u002Ffixtures\u002Fskills\u002Fgood-skill\u002FSKILL.md",[],[77,78,79,80,81,82,83,84,85,86,87,88,89,90],"good","good skill","valid skill","valid","plugin","lint","only","shape","minimal","fixture","input","well formed","frontmatter","skill fixture",{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":38},"01M6NNMY4GWFD65V1Q2W5YC465","bad-skill-missing-field","https:\u002F\u002Fgithub.com\u002Frevealui-studio\u002Frevskills\u002Fblob\u002Ftest\u002Ftest\u002Ffixtures\u002Fskills\u002Fbad-skill-missing-field\u002FSKILL.md",[],[97,98,99,100,101],"bad","missing","missing field","bad skill missing field","bad skill",{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":38},"01M6NNMF7WN6C308H8CGJVRBCB","bad-skill-awk","Fixture skill whose fenced shell block violates lint-skill.awk. skills-lint must reject it.","https:\u002F\u002Fgithub.com\u002Frevealui-studio\u002Frevskills\u002Fblob\u002Ftest\u002Ftest\u002Ffixtures\u002Fskills\u002Fbad-skill-awk\u002FSKILL.md",[],[109,110,97,101,82,111,112,113,86,114],"bad skill awk","awk","shell","block","fixture skill","it",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":38},"01M6NNMB2BYCM9J8GVW3TJ8YA7","yjs-collaboration","Yjs CRDT collaboration patterns for real-time and offline-first editing. Use when building collaborative documents, shared scratchpads, or multi-user editing. Covers Y.Doc, Y.Map, Y.Array, Y.Text, state encoding, structured patches, server-side document manipulation, and conflict-free merge semantics.","https:\u002F\u002Fgithub.com\u002Frevealui-studio\u002Frevskills\u002Fblob\u002Ftest\u002Fskills\u002Fyjs-collaboration\u002FSKILL.md",[],[122,123,124,125,25,126,127,128,129,130,131,28,21,19,132,133,134,135,136,137],"yjs","yjs collaboration","collaboration","for","free","server-side","conflict","shared","time","map","doc","real-time","offline","documents","merge","text",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":38},"01M6NNM6VE7WE8ZAWQFS4AZE1P","vitest-testing","Vitest testing patterns for production TypeScript projects. Use when writing tests, fixing test failures, configuring coverage, mocking modules, debugging flaky tests, or setting up Vitest in a monorepo. Covers Vitest 3+, vi.mock, vi.fn, React Testing Library, PGlite in-memory PostgreSQL, pool forks, maxWorkers, and hookTimeout.","https:\u002F\u002Fgithub.com\u002Frevealui-studio\u002Frevskills\u002Fblob\u002Ftest\u002Fskills\u002Fvitest-testing\u002FSKILL.md",[],[145,146,147,148,149,150,151,152,125,153,154,155,156,157,158,29,159,160,161,162],"vitest testing","testing","vitest","debugging","memory","writing","testing library","mock","react testing library","mocking","tests","react testing","modules","up","coverage","monorepo","projects","testing patterns",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":38},"01M6NNKSJ6TJBVPDN3YJHK5B70","tailwind-v4","Tailwind CSS v4 patterns, CSS-first configuration, and v3 migration guide. Use when writing styles, configuring @theme variables, creating components with CVA, migrating from tailwind.config.js, or using container queries, dark mode, and new v4 utility syntax. Covers @import tailwindcss, custom properties, oklch colors, and clsx.","https:\u002F\u002Fgithub.com\u002Frevealui-studio\u002Frevskills\u002Fblob\u002Ftest\u002Fskills\u002Ftailwind-v4\u002FSKILL.md",[],[170,171,172,173,22,174,25,175,176,177,178,179,180,181,182,29,183,184,185,150],"tailwind v4","Tailwind","utility","dark","mode","Variables","with","theme","import","dark mode","v3","queries","container","components","tailwindcss","css"]