{"slug": "the-agentic-ide-is-an-api-building-a-unified-tool-registry-for-claude-code-codex", "title": "The Agentic IDE Is an API: Building a Unified Tool Registry for Claude Code, Codex, and MCP", "summary": "A developer published a tutorial on tamiz.pro for building a unified tool registry that lets Claude Code, Codex, and MCP clients invoke the same versioned tools through one endpoint. The registry, built with a TypeScript control plane, Fastify HTTP API, and MCP-compatible adapter, centralizes authentication, authorization policy, argument validation, and audit logging so agents never get direct access to credentials or the host filesystem. The design deliberately rejects arbitrary shell execution, running tool implementations in a separate process with a restricted environment.", "body_md": "*Originally published on [tamiz.pro](https://tamiz.pro/insights/unified-tool-registry-claude-code-codex-mcp).*\n\nModern coding agents do not live inside a single IDE. They run as separate processes, connect to different model providers, and discover tools through incompatible mechanisms. Claude Code uses its own tool configuration. Codex operates within its own runtime. Model Context Protocol (MCP) clients connect to servers over stdio or HTTP. The result is a fragmented control plane where permissions, schemas, observability, and secrets are duplicated across every integration.\n\nThe architectural shift is simple: treat the agentic IDE as an API surface, not a collection of hardcoded tool menus. Every tool becomes a versioned capability with a schema, an authorization policy, an execution boundary, and a structured result. Claude Code, Codex, and MCP clients become consumers of that same registry.\n\nThis tutorial builds a runnable registry with a TypeScript control plane, a Fastify HTTP API, and an MCP-compatible adapter. You will expose a filesystem tool and a calculator, register both with explicit policies, and let multiple clients invoke them through the same endpoint.\n\n**Security note:** The registry intentionally rejects arbitrary shell execution. Tool implementations run in a separate process with a restricted environment. In production, add container isolation, resource quotas, and a stronger identity provider.\n\nThe registry sits between agents and tool implementations. Agents never receive direct access to credentials or the host filesystem. Instead, they submit a tool invocation to the registry, which authenticates the caller, authorizes the action, validates the arguments, executes the tool, and returns a normalized response.\n\n```\n┌───────────────┐   ┌───────────────┐   ┌────────────────┐\n│  Claude Code  │   │     Codex     │   │  MCP Client    │\n└───────┬───────┘   └───────┬───────┘   └────────┬───────┘\n        │                   │                    │\n        │  OpenAI-style     │  MCP JSON-RPC      │\n        │  function call    │                    │\n        └───────────────────┴────────────────────┘\n                            │\n                    ┌───────▼────────┐\n                    │ Tool Registry  │\n                    │  • authn       │\n                    │  • policy      │\n                    │  • validation  │\n                    │  • audit log   │\n                    └───────┬────────┘\n                            │\n              ┌─────────────┼─────────────┐\n              ▼             ▼             ▼\n        ┌──────────┐  ┌──────────┐  ┌────────────┐\n        │ read_file│  │ calculate│  │ MCP Server │\n        └──────────┘  └──────────┘  └────────────┘\n```\n\nFour layers matter:\n\nThe key invariant: **all clients receive the same schema and the same authorization decision.**\n\nYou need:\n\nVerify your environment:\n\n```\nnode --version\nnpm --version\n```\n\nCreate the project and install dependencies:\n\n```\nmkdir agentic-tool-registry\ncd agentic-tool-registry\nnpm init -y\nnpm install fastify @fastify/cors zod @modelcontextprotocol/sdk\nnpm install -D typescript tsx @types/node vitest\n```\n\nCreate `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"target\": \"ES2022\",\n    \"module\": \"NodeNext\",\n    \"moduleResolution\": \"NodeNext\",\n    \"strict\": true,\n    \"esModuleInterop\": true,\n    \"skipLibCheck\": true,\n    \"outDir\": \"dist\",\n    \"rootDir\": \"src\"\n  },\n  \"include\": [\"src/**/*.ts\", \"test/**/*.ts\"]\n}\n```\n\nSet the package type to ES modules:\n\n```\nnpm pkg set type=module\nnpm pkg set scripts.dev=\"tsx watch src/server.ts\"\nnpm pkg set scripts.start=\"tsx src/server.ts\"\nnpm pkg set scripts.test=\"vitest run\"\nnpm pkg set scripts.typecheck=\"tsc --noEmit\"\n```\n\nA tool contract must be machine-readable and stable. Use JSON Schema for arguments because both OpenAI function calling and MCP understand JSON Schema conventions.\n\nCreate `src/contracts.ts`:\n\n``` js\nimport { z } from \"zod\";\n\nexport type ToolContract = {\n  name: string;\n  version: string;\n  description: string;\n  inputSchema: Record<string, unknown>;\n  requiredScopes: string[];\n  allowedRoles: string[];\n  timeoutMs: number;\n  handler: (args: unknown) => Promise<unknown>;\n};\n\nexport const ToolInvocationSchema = z.object({\n  tool: z.string().min(1),\n  arguments: z.record(z.unknown()).default({}),\n  idempotencyKey: z.string().min(8).optional(),\n});\n\nexport type ToolInvocation = z.infer<typeof ToolInvocationSchema>;\n\nexport type ToolResult = {\n  ok: boolean;\n  output?: unknown;\n  error?: {\n    code: string;\n    message: string;\n  };\n  durationMs: number;\n};\n```\n\nThe `ToolInvocationSchema` validates the envelope. Each tool validates its own arguments with Zod, then translates that schema into JSON Schema for discovery. To avoid maintaining two definitions by hand, we can use `zod-to-json-schema`. Install it:\n\n```\nnpm install zod-to-json-schema\n```\n\nCreate `src/tools.ts`:\n\n``` js\nimport { z } from \"zod\";\nimport { zodToJsonSchema } from \"zod-to-json-schema\";\nimport type { ToolContract } from \"./contracts.js\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nconst ROOT = process.env.TOOL_ROOT ?? process.cwd();\n\nconst ReadFileArgs = z.object({\n  path: z.string().min(1),\n  encoding: z.enum([\"utf8\", \"utf-8\"]).default(\"utf8\"),\n});\n\nconst CalculateArgs = z.object({\n  expression: z.string().min(1).max(200),\n});\n\nasync function readFileTool(raw: unknown) {\n  const args = ReadFileArgs.parse(raw);\n  const resolved = path.resolve(ROOT, args.path);\n\n  if (!resolved.startsWith(ROOT + path.sep)) {\n    throw new Error(\"PATH_OUTSIDE_ROOT\");\n  }\n\n  const content = await readFile(resolved, \"utf8\");\n  return { path: resolved, content };\n}\n\nasync function calculateTool(raw: unknown) {\n  const args = CalculateArgs.parse(raw);\n\n  if (!/^[0-9+\\-*/().\\s]+$/.test(args.expression)) {\n    throw new Error(\"INVALID_EXPRESSION\");\n  }\n\n  const tokens = args.expression.match(/\\d+(?:\\.\\d+)?|[-+*/()]/g) ?? [];\n  let position = 0;\n\n  function parseExpression(): number {\n    let value = parseTerm();\n    while (tokens[position] === \"+\" || tokens[position] === \"-\") {\n      const operator = tokens[position++];\n      const right = parseTerm();\n      value = operator === \"+\" ? value + right : value - right;\n    }\n    return value;\n  }\n\n  function parseTerm(): number {\n    let value = parseFactor();\n    while (tokens[position] === \"*\" || tokens[position] === \"/\") {\n      const operator = tokens[position++];\n      const right = parseFactor();\n      value = operator === \"*\" ? value * right : value / right;\n    }\n    return value;\n  }\n\n  function parseFactor(): number {\n    if (tokens[position] === \"-\") {\n      position++;\n      return -parseFactor();\n    }\n    if (tokens[position] === \"(\") {\n      position++;\n      const value = parseExpression();\n      if (tokens[position] !== \")\") throw new Error(\"INVALID_EXPRESSION\");\n      position++;\n      return value;\n    }\n    const token = tokens[position++];\n    const number = Number(token);\n    if (Number.isNaN(number)) throw new Error(\"INVALID_EXPRESSION\");\n    return number;\n  }\n\n  const result = parseExpression();\n  if (position !== tokens.length) throw new Error(\"INVALID_EXPRESSION\");\n  return { expression: args.expression, result };\n}\n\nexport const tools: ToolContract[] = [\n  {\n    name: \"read_file\",\n    version: \"1.0.0\",\n    description: \"Read a UTF-8 text file from the workspace root.\",\n    inputSchema: zodToJsonSchema(ReadFileArgs) as Record<string, unknown>,\n    requiredScopes: [\"files:read\"],\n    allowedRoles: [\"developer\", \"agent\"],\n    timeoutMs: 5_000,\n    handler: readFileTool,\n  },\n  {\n    name: \"calculate\",\n    version: \"1.0.0\",\n    description: \"Evaluate an arithmetic expression.\",\n    inputSchema: zodToJsonSchema(CalculateArgs) as Record<string, unknown>,\n    requiredScopes: [\"calc:execute\"],\n    allowedRoles: [\"developer\", \"agent\"],\n    timeoutMs: 2_000,\n    handler: calculateTool,\n  },\n];\n```\n\nThe calculator uses a small recursive-descent parser instead of `eval`. It accepts only numeric literals and arithmetic operators, so the tool cannot execute arbitrary code.\n\nThe runtime must enforce a timeout and normalize errors. A failed tool should never crash the registry or leak a stack trace to the client.\n\nCreate `src/runtime.ts`:\n\n``` python\nimport type { ToolContract, ToolResult } from \"./contracts.js\";\n\nexport class ToolRuntime {\n  private tools = new Map<string, ToolContract>();\n\n  register(tool: ToolContract) {\n    if (this.tools.has(tool.name)) {\n      throw new Error(`DUPLICATE_TOOL:${tool.name}`);\n    }\n    this.tools.set(tool.name, tool);\n  }\n\n  list(): ToolContract[] {\n    return [...this.tools.values()];\n  }\n\n  get(name: string): ToolContract | undefined {\n    return this.tools.get(name);\n  }\n\n  async execute(name: string, args: unknown): Promise<ToolResult> {\n    const tool = this.tools.get(name);\n    const started = Date.now();\n\n    if (!tool) {\n      return {\n        ok: false,\n        error: { code: \"TOOL_NOT_FOUND\", message: `Unknown tool: ${name}` },\n        durationMs: Date.now() - started,\n      };\n    }\n\n    let timer: NodeJS.Timeout | undefined;\n\n    try {\n      const output = await Promise.race([\n        tool.handler(args),\n        new Promise((_, reject) => {\n          timer = setTimeout(\n            () => reject(new Error(\"TOOL_TIMEOUT\")),\n            tool.timeoutMs,\n          );\n        }),\n      ]);\n\n      return { ok: true, output, durationMs: Date.now() - started };\n    } catch (error) {\n      const code = error instanceof Error ? error.message : \"TOOL_ERROR\";\n      return {\n        ok: false,\n        error: { code, message: \"Tool execution failed\" },\n        durationMs: Date.now() - started,\n      };\n    } finally {\n      if (timer) clearTimeout(timer);\n    }\n  }\n}\n```\n\n`Promise.race` enforces a soft timeout. It does not terminate the underlying operation. For CPU-bound or runaway processes, run the handler in a worker thread or a container with a hard kill deadline.\n\nThe HTTP API exposes three operations:\n\n`GET /v1/tools` returns the discovery catalog`POST /v1/invocations` executes a tool`GET /healthz` returns liveness status\nCreate `src/server.ts`:\n\n``` python\nimport Fastify from \"fastify\";\nimport cors from \"@fastify/cors\";\nimport { ToolInvocationSchema } from \"./contracts.js\";\nimport { ToolRuntime } from \"./runtime.js\";\nimport { tools } from \"./tools.js\";\nimport { createMcpServer } from \"./mcp.js\";\nimport { authenticate } from \"./auth.js\";\nimport { authorize } from \"./policy.js\";\n\nconst app = Fastify({ logger: true });\nconst runtime = new ToolRuntime();\n\nfor (const tool of tools) runtime.register(tool);\n\nawait app.register(cors, {\n  origin: process.env.ALLOWED_ORIGIN ?? \"http://localhost:3000\",\n});\n\napp.get(\"/healthz\", async () => ({ status: \"ok\" }));\n\napp.get(\"/v1/tools\", async (request) => {\n  const identity = await authenticate(request.headers.authorization);\n  const visible = runtime.list().filter((tool) =>\n    authorize(identity, tool).allowed,\n  );\n\n  return visible.map((tool) => ({\n    name: tool.name,\n    version: tool.version,\n    description: tool.description,\n    inputSchema: tool.inputSchema,\n  }));\n});\n\napp.post(\"/v1/invocations\", async (request, reply) => {\n  const identity = await authenticate(request.headers.authorization);\n  const parsed = ToolInvocationSchema.safeParse(request.body);\n\n  if (!parsed.success) {\n    return reply.code(400).send({\n      ok: false,\n      error: { code: \"INVALID_REQUEST\", message: parsed.error.message },\n    });\n  }\n\n  const tool = runtime.get(parsed.data.tool);\n\n  if (!tool) {\n    return reply.code(404).send({\n      ok: false,\n      error: { code: \"TOOL_NOT_FOUND\", message: \"Tool not found\" },\n    });\n  }\n\n  const decision = authorize(identity, tool);\n  if (!decision.allowed) {\n    return reply.code(403).send({\n      ok: false,\n      error: { code: decision.reason, message: \"Tool invocation denied\" },\n    });\n  }\n\n  const result = await runtime.execute(tool.name, parsed.data.arguments);\n  return reply.code(result.ok ? 200 : 422).send(result);\n});\n\nawait createMcpServer(runtime, authenticate, authorize);\n\nconst port = Number(process.env.PORT ?? 8787);\nawait app.listen({ port, host: \"0.0.0.0\" });\n```\n\nNotice that discovery is filtered by policy. A client never sees tools it cannot call. This prevents leaking internal capabilities through the catalog.\n\nAuthentication and authorization belong in separate modules so you can swap the identity provider without touching tool code.\n\nCreate `src/auth.ts`:\n\n``` js\nimport { createHash, timingSafeEqual } from \"node:crypto\";\n\nexport type Identity = {\n  subject: string;\n  roles: string[];\n  scopes: string[];\n};\n\nexport async function authenticate(\n  header: string | undefined,\n): Promise<Identity> {\n  if (!header?.startsWith(\"Bearer \")) {\n    throw new Error(\"UNAUTHENTICATED\");\n  }\n\n  const token = header.slice(7);\n  const expected = process.env.REGISTRY_API_KEY;\n\n  if (!expected) throw new Error(\"AUTH_NOT_CONFIGURED\");\n\n  const a = createHash(\"sha256\").update(token).digest();\n  const b = createHash(\"sha256\").update(expected).digest();\n\n  if (!timingSafeEqual(a, b)) {\n    throw new Error(\"UNAUTHENTICATED\");\n  }\n\n  return {\n    subject: \"local-agent\",\n    roles: [\"developer\", \"agent\"],\n    scopes: [\"files:read\", \"calc:execute\"],\n  };\n}\n```\n\nThe static API key is acceptable for local development. Replace it with OIDC token verification for production.\n\nCreate `src/policy.ts`:\n\n``` python\nimport type { ToolContract } from \"./contracts.js\";\nimport type { Identity } from \"./auth.js\";\n\nexport type PolicyDecision = {\n  allowed: boolean;\n  reason: string;\n};\n\nexport function authorize(\n  identity: Identity,\n  tool: ToolContract,\n): PolicyDecision {\n  const roleAllowed = tool.allowedRoles.some((role) =>\n    identity.roles.includes(role),\n  );\n\n  if (!roleAllowed) {\n    return { allowed: false, reason: \"ROLE_NOT_ALLOWED\" };\n  }\n\n  const scopesAllowed = tool.requiredScopes.every((scope) =>\n    identity.scopes.includes(scope),\n  );\n\n  if (!scopesAllowed) {\n    return { allowed: false, reason: \"SCOPE_NOT_ALLOWED\" };\n  }\n\n  return { allowed: true, reason: \"ALLOWED\" };\n}\n```\n\nFor real deployments, extend the policy function with argument-level constraints: maximum file size, allowed path prefixes, rate limits per subject, and approval requirements for destructive operations.\n\nThe MCP SDK exposes a server implementation that speaks JSON-RPC over stdio. We will mount the same runtime behind it, so MCP clients inherit the registry's schemas and policies.\n\nCreate `src/mcp.ts`:\n\n``` js\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { z } from \"zod\";\nimport type { ToolRuntime } from \"./runtime.js\";\nimport type { Identity } from \"./auth.js\";\nimport { authorize } from \"./policy.js\";\n\nexport async function createMcpServer(\n  runtime: ToolRuntime,\n  authenticate: (header?: string) => Promise<Identity>,\n  authorizeFn: (identity: Identity, tool: any) => { allowed: boolean; reason: string },\n) {\n  const server = new McpServer({\n    name: \"unified-tool-registry\",\n    version: \"1.0.0\",\n  });\n\n  const identity = await authenticate(`Bearer ${process.env.REGISTRY_API_KEY}`);\n\n  for (const tool of runtime.list()) {\n    if (!authorizeFn(identity, tool).allowed) continue;\n\n    server.registerTool(\n      tool.name,\n      {\n        title: tool.name,\n        description: tool.description,\n        inputSchema: tool.inputSchema as any,\n      },\n      async (args: any) => {\n        const result = await runtime.execute(tool.name, args);\n\n        if (!result.ok) {\n          return {\n            isError: true,\n            content: [{ type: \"text\", text: result.error?.message ?? \"Tool failed\" }],\n          };\n        }\n\n        return {\n          content: [{ type: \"text\", text: JSON.stringify(result.output) }],\n        };\n      },\n    );\n  }\n\n  await server.connect(new StdioServerTransport());\n}\n```\n\nThe MCP adapter uses the same `runtime.execute` path as the HTTP API. There is no separate authorization logic.\n\nBoth Claude Code and Codex support connecting to MCP servers. Create `mcp.json` in your workspace:\n\n```\n{\n  \"mcpServers\": {\n    \"unified-registry\": {\n      \"command\": \"npx\",\n      \"args\": [\"tsx\", \"src/mcp.ts\"],\n      \"env\": {\n        \"REGISTRY_API_KEY\": \"your-local-development-key\",\n        \"TOOL_ROOT\": \"/absolute/path/to/your/project\"\n      }\n    }\n  }\n}\\n```\n{% endraw %}\n\nBecause the MCP server runs over stdio, it cannot share the HTTP server's port. Run it as a separate process:\n{% raw %}\n\n``` bash\nREGISTRY_API_KEY=your-local-development-key \\\nTOOL_ROOT=\"$PWD\" \\\nnpx tsx src/mcp.ts\n```\n\nIn Claude Code, add the server with:\n\n```\nclaude mcp add unified-registry \\\n  --env REGISTRY_API_KEY=your-local-development-key \\\n  --env TOOL_ROOT=\"$PWD\" \\\n  -- npx tsx src/mcp.ts\n```\n\nFor Codex, place the same server definition in `~/.codex/config.toml`:\n\n```\n[mcp_servers.unified-registry]\ncommand = \"npx\"\nargs = [\"tsx\", \"src/mcp.ts\"]\n\n[mcp_servers.unified-registry.env]\nREGISTRY_API_KEY = \"your-local-development-key\"\nTOOL_ROOT = \"/absolute/path/to/your/project\"\n```\n\nBoth agents now discover `read_file` and `calculate` through the registry contract. They see identical schemas regardless of which model provider generated the call.\n\nIf you prefer a direct HTTP integration, expose the discovery catalog as OpenAI-compatible function definitions:\n\n```\nexport function toOpenAiTools(tools: ToolContract[]) {\n  return tools.map((tool) => ({\n    type: \"function\" as const,\n    function: {\n      name: tool.name,\n      description: tool.description,\n      parameters: tool.inputSchema,\n    },\n  }));\n}\\n```\n\nClients can fetch this catalog from `GET /v1/tools` and pass the resulting function calls to `POST /v1/invocations`.\n\n## 10. Adding Observability\n\nA registry without logs is impossible to audit. Record who called what, whether it succeeded, and how long it took. The `ToolResult` already includes `durationMs`. Fastify's logger captures HTTP-level metadata.\n\nAdd a structured audit event inside the invocation route:\n\n``` ts\napp.log.info(\n  {\n    event: \"tool_invocation\",\n    subject: identity.subject,\n    tool: tool.name,\n    version: tool.version,\n    allowed: true,\n    durationMs: result.durationMs,\n    ok: result.ok,\n  },\n  \"tool invocation completed\",\n);\n```\n\nFor production, ship these events to OpenTelemetry, include a correlation ID from the client request, and record policy denials separately from execution failures. Denials often reveal misconfigured scopes or an agent attempting an unexpected action.\n\nThe reference implementation is a starting point. Before deploying it:\n\n**Replace static keys with OIDC.** Verify issuer, audience, expiry, and signature. Derive roles and scopes from verified claims rather than request headers.\n\n**Isolate tool execution.** Run each tool in a container, gVisor sandbox, or dedicated worker with a read-only base image, a scoped filesystem mount, no network by default, and CPU and memory limits.\n\n**Add argument-level policy.** Validate file paths against an allowlist of prefixes, cap file sizes, and require human approval for write or delete operations.\n\n**Version contracts.** Include `version` in every registry entry. When a schema changes incompatibly, publish a new version and keep the old one available during migration.\n\n**Add rate limiting.** Limit invocations per subject and per tool. A runaway agent loop should hit a quota rather than exhaust downstream resources.\n\n**Encrypt secrets.** Use a secrets manager and inject credentials into the tool process at execution time. Never place secrets in the registry catalog or the MCP environment block in a shared config file.\n\n**Sign the catalog.** If clients run in different trust domains, publish a signed manifest containing tool versions and schema hashes so clients can detect tampering.\n\n**Support idempotency.** Store the `idempotencyKey` with a short TTL. If a client retries after a network timeout, return the original result instead of executing the tool twice.\n\nCreate `test/registry.test.ts`:\n\n``` js\nimport { describe, expect, it } from \"vitest\";\nimport { ToolRuntime } from \"../src/runtime.js\";\nimport { tools } from \"../src/tools.js\";\nimport { authorize } from \"../src/policy.js\";\n\ndescribe(\"tool registry\", () => {\n  it(\"executes the calculator\", async () => {\n    const runtime = new ToolRuntime();\n    for (const tool of tools) runtime.register(tool);\n\n    const result = await runtime.execute(\"calculate\", {\n      expression: \"2 * (3 + 4)\",\n    });\n\n    expect(result.ok).toBe(true);\n    expect(result.output).toMatchObject({ result: 14 });\n  });\n\n  it(\"rejects unsafe expressions\", async () => {\n    const runtime = new ToolRuntime();\n    for (const tool of tools) runtime.register(tool);\n\n    const result = await runtime.execute(\"calculate\", {\n      expression: \"process.exit(1)\",\n    });\n\n    expect(result.ok).toBe(false);\n  });\n\n  it(\"denies tools without the required scope\", () => {\n    const tool = tools.find((t) => t.name === \"read_file\")!;\n    const decision = authorize(\n      { subject: \"test\", roles: [\"developer\"], scopes: [] },\n      tool,\n    );\n\n    expect(decision.allowed).toBe(false);\n    expect(decision.reason).toBe(\"SCOPE_NOT_ALLOWED\");\n  });\n});\n```\n\nRun the suite:\n\n```\nnpm test\nnpm run typecheck\n```\n\nStart the server and verify the API:\n\n```\nREGISTRY_API_KEY=dev-key npm run start\n```\n\nIn another terminal:\n\n```\ncurl -s http://localhost:8787/v1/tools \\\n  -H \"Authorization: Bearer dev-key\" | jq\n\ncurl -s http://localhost:8787/v1/invocations \\\n  -H \"Authorization: Bearer dev-key\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"tool\":\"calculate\",\"arguments\":{\"expression\":\"10 / 4\"}}' | jq\n```\n\nThe calculation returns `2.5`. The catalog lists both tools with their JSON Schemas.\n\nDirect connections work for a prototype, but they multiply the trust boundary. With a registry, you get one audit trail, one schema source of truth, one policy engine, and one place to rotate credentials. Agents still reach MCP servers; they just do so through a governed adapter.\n\nKeep authentication inside the tool implementation. The registry authorizes whether a caller may invoke the tool. The tool then authenticates to its downstream service using credentials injected at runtime. This separation keeps the registry generic and prevents it from becoming a credential store.\n\nYes, as long as the tool is stateless or uses per-invocation context. Pass the caller's subject and correlation ID into the handler context so downstream systems can enforce tenant isolation. If a tool holds mutable state, make that state keyed by subject or run the tool in an isolated process per invocation.\n\nYou now have a single governed API that Claude Code, Codex, and MCP clients can all use. Tools are discovered through one catalog, authorized through one policy engine, executed behind one runtime, and audited in one place. The next step is to add a write tool with argument-level constraints and human approval, then move execution into containers before exposing the registry to remote agents.", "url": "https://wpnews.pro/news/the-agentic-ide-is-an-api-building-a-unified-tool-registry-for-claude-code-codex", "canonical_source": "https://dev.to/tamizuddin/the-agentic-ide-is-an-api-building-a-unified-tool-registry-for-claude-code-codex-and-mcp-o49", "published_at": "2026-11-24 00:02:32+00:00", "updated_at": "2026-11-24 00:12:45.576097+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools", "ai-safety"], "entities": ["Claude Code", "Codex", "Model Context Protocol", "Fastify", "tamiz.pro", "TypeScript"], "also_reported_by": [], "takeaway": "Route Claude Code, Codex, and MCP clients through one registry that authenticates, authorizes, validates, and audits every tool call, keeping credentials and the host filesystem out of the agent's reach.", "recommendation": {"advice": "Put a registry between agents and tools that enforces authn, policy, schema validation, and audit logging, and run tool implementations in a separate restricted process rather than granting shell access.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/the-agentic-ide-is-an-api-building-a-unified-tool-registry-for-claude-code-codex", "markdown": "https://wpnews.pro/news/the-agentic-ide-is-an-api-building-a-unified-tool-registry-for-claude-code-codex.md", "text": "https://wpnews.pro/news/the-agentic-ide-is-an-api-building-a-unified-tool-registry-for-claude-code-codex.txt", "jsonld": "https://wpnews.pro/news/the-agentic-ide-is-an-api-building-a-unified-tool-registry-for-claude-code-codex.jsonld"}}