quickstart-resources/mcp-client-typescript
Repository files (latest commit first)
Filename Latest commit message Latest commit date
olaservo 1a0ad1cc80 Fix tool use in TypeScript client, mirroring #141
Apply the same Messages API tool-use fixes that #141 made to the Python
client (mcp-client-python/client.py) to mcp-client-typescript/index.ts:

- Reply to each tool_use with a proper tool_result block carrying
  tool_use_id, and append the assistant's full content (preserving the
  tool_use block) instead of sending the result as a plain user string.
- Restructure processQuery into a turn-level loop so parallel tool calls
  in one response and chained tool calls across turns both work; pass
  tools on every follow-up request.
- Add MAX_TOOL_TURNS = 10 cap with a "[Stopped after N tool-use turns]"
  notice to prevent unbounded tool-use loops.
- Fix chatLoop to exit cleanly on EOF (Ctrl-D) and SIGINT (Ctrl-C) via
  an AbortController wired to readline close, instead of hanging or
  throwing on stdin EOF.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-30 11:47:53 -07:00
..
.env.example Add mcp-client-typescript 2025-02-17 11:16:18 -08:00
.gitignore Add mcp-client-typescript 2025-02-17 11:16:18 -08:00
index.ts Fix tool use in TypeScript client, mirroring #141 2026-05-30 11:47:53 -07:00
package-lock.json Bump the npm_and_yarn group across 3 directories with 1 update 2026-05-23 12:40:48 +00:00
package.json Bump the npm_and_yarn group across 3 directories with 1 update 2026-02-04 20:39:15 +00:00
README.md Update quickstart URLs (#140) 2026-05-16 08:59:02 -07:00
tsconfig.json Prettier formatting 2025-02-19 10:30:17 -08:00

An LLM-Powered Chatbot MCP Client written in TypeScript

See the Build an MCP client tutorial for more information.