Skip to content

Latest commit

 

History

107 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Impossible G — ReAct Agent

Impossible ReAct Agent

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.

A reasoning, action, observation, and continuation loop

Included

  • current LangChain createAgent runtime 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

Start locally

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?"

HTTP API

npm start -- --serve
curl 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.

Add MCP tools

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.

Commands

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

Documentation

License

MIT

About

A production-ready TypeScript template for MCP servers with tools, resources, prompts, stdio and Streamable HTTP transports, testing, Docker, and operational safeguards.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages