Skip to content

LOU-K1: export MCP client on public API surface - #12

Merged
LinuxDevil merged 1 commit into
mainfrom
loushy/lou-k1
Sep 28, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
loushy/lou-k1

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

A published audit found that the SDK's MCP (Model Context Protocol) client (McpToolLoader / loadMcpTools() in src/tools/mcp/) was fully implemented and tested but not reachable from the public API surface: it was missing from src/tools/index.ts, and there was no ./mcp subpath in package.json's exports map. Consumers could only reach it via an unsupported deep relative import into dist/tools/mcp/....

Changes

  • Add src/tools/mcp/index.ts barrel exporting loadMcpTools, listRemoteTools, RawMcpTool, and jsonSchemaToZod (the same "export what's meant to be public, skip internals" pattern used by other barrels like src/execution/index.ts).
  • Add export * from './mcp'; to src/tools/index.ts so the loader is reachable from the package root and from @loushy/build-ai-agent/tools.
  • Add a "./mcp" entry to package.json's exports map, matching the shape of the existing "./tools" entry (types/import/require -> dist/tools/mcp/index.*).
  • Add 'tools/mcp/index': 'src/tools/mcp/index.ts' as an explicit tsup entry point (tsup.config.ts lists entries explicitly, not via glob) so dist/tools/mcp/index.{js,mjs,d.ts,d.mts} is actually emitted.
  • Document the new export with a short usage snippet in docs/api-overview.md (Tools table) and docs/configuration.md (new "MCP (Model Context Protocol) tools" subsection under Agent spec files, since MCP tools are loaded programmatically rather than referenced by name in a spec).

Out of scope: the Section 10 audit artifact itself is handled separately.

Test plan

  • npm run typecheck - clean, no errors
  • npm run lint - 0 new errors/warnings (pre-existing 5 errors are unrelated require()-in-fixture lint findings in src/execution/__fixtures__/sample-repo/, untouched by this change)
  • npx vitest run src/tools/mcp - 3 files / 18 tests passed
  • npx vitest run docs/docs-links.test.ts src/tools/mcp - 4 files / 28 tests passed
  • npm run build - tsup build succeeds and emits dist/tools/mcp/index.js, dist/tools/mcp/index.mjs, dist/tools/mcp/index.d.ts, dist/tools/mcp/index.d.mts

🤖 Generated with Claude Code

An audit found McpToolLoader / loadMcpTools() fully implemented and
tested in src/tools/mcp/ but unreachable from the public API: it was
missing from src/tools/index.ts and had no ./mcp subpath export, so
consumers could only reach it via an unsupported deep import into
dist/tools/mcp/.

- Add src/tools/mcp/index.ts barrel re-exporting loadMcpTools,
  listRemoteTools, RawMcpTool, and jsonSchemaToZod.
- Re-export it from src/tools/index.ts so it's reachable from the
  package root and @loushy/build-ai-agent/tools.
- Add a "./mcp" entry to package.json's exports map, mirroring the
  existing "./tools" shape.
- Add tools/mcp/index as an explicit tsup entry point so dist/tools/mcp/index.*
  is actually emitted.
- Document the new export with a short snippet in docs/api-overview.md
  and docs/configuration.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@LinuxDevil
LinuxDevil merged commit fea3ab8 into main Sep 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant