A TypeScript template for an agent that reasons, calls local or MCP tools, observes their results, and continues until it can answer. It defaults to a local OpenAI-compatible model endpoint and also accepts any compatible hosted endpoint you configure.
ReAct means Reasoning and Acting. This repository is an agent runtime, not a React user interface.
- current LangChain
createAgentruntime backed by LangGraph - local OpenAI-compatible model configuration
- built-in example tools and optional MCP tool discovery
- conversation threads with in-memory checkpointing
- step limits, request deadlines, cancellation, and graceful shutdown
- CLI, terminal JSON, and server-sent event HTTP entry points
- strict TypeScript, protocol-independent tests, integration tests, and coverage gates
- Docker, Compose, CI, security scanning, and release automation
- complete documentation and Impossible G repository artwork
Use any server that exposes an OpenAI-compatible chat-completions API. The defaults expect Ollama on http://127.0.0.1:11434/v1 with qwen3:8b.
npm install
cp .env.example .env
npm run build
npm start -- --input "Count the words in: local models belong to you"On PowerShell:
Copy-Item .env.example .env
npm run build
npm start -- --input "What time is it?"npm start -- --servecurl http://127.0.0.1:4141/v1/chat \
-H "content-type: application/json" \
-d '{"input":"Count the words in this sentence","threadId":"demo"}'Health and readiness routes are available at /healthz and /readyz.
For incremental model output, send the same request body to /v1/chat/stream and consume the server-sent events.
Create a configuration file:
{
"mcpServers": {
"local-tools": {
"command": "node",
"args": ["../impossible-mcp-template/dist/cli.js"]
}
}
}Set MCP_CONFIG_PATH to its path. Tools from every configured server become available beside the built-in examples.
| Command | Purpose |
|---|---|
npm run dev -- --input "..." |
Run one prompt with source files |
npm run dev -- --serve |
Start the development HTTP API |
npm run build |
Compile the production package |
npm test |
Run tests once |
npm run test:coverage |
Run tests and enforce coverage gates |
npm run verify |
Run formatting, linting, types, coverage, and build |

