Video in the works
TermiX
An agent finding the right MCP tool, asking permission, and using it live.

About the project
TermiX is an app where people use crypto and blockchains just by chatting: check a wallet, research a token, swap, or run a trading strategy. I built most of its AI: the chat assistant, the tools it can use, its memory and its knowledge base, and before that, in 2024, its first agents and Diviner, a reading tool for memecoins.
TermiX is a crypto platform where people and AI agents use blockchains just by asking: check a wallet, research a token, swap, or run a trading strategy, all in plain language.
I joined the team at Metaline in January 2024, and it became TermiX. In 2024 I built its first AI agents: a chat layer that turned plain requests into actions for 11 crypto agents, and much of the year went into Diviner, a tool for Solana memecoins: paste a token's address and it gives a reading that mixes market data with a fortune-teller's voice, in English or Chinese. From April 2025 I built most of its AI chat: the streaming agent, its connection to MCP tool servers (MCP is a standard way to plug outside tools into an AI), the approval step before any tool runs, its memory, its knowledge base, and the safety levels for tools that can move money.
The agent can reach hundreds of tools on dozens of MCP servers. So most of the work was about making that safe and reliable: the right tools at the right time, no endless loops, and no action without the user's say.
How it works
Ask
The user writes a request in the chat and picks a model.
Add context
The backend adds a summary of the conversation, the recent messages and any matching knowledge-base entries, and lists the tools from the MCP servers the user has switched on.
The model asks for a tool
The reply streams in. When the model wants a tool, the request goes to the user's browser.
Approve and run
The user approves once or for the whole session. The tool runs through a server route that fetches a fresh token for that MCP server.
Check and continue
The result goes back to the model, and a checker decides whether the task is done, failed, or needs another step.
Under the hood
- Chat backend
- Koa and TypeScript: streaming over SSE, a route to continue after a tool runs, and history saved with Prisma.
- MCP client layer
- In the Next.js app: connects to MCP servers over SSE or Streamable HTTP, through server routes for listing and calling tools.
- Model routing
- OpenRouter with Claude and 14 models, tools formatted per provider, and a fixer for broken tool schemas.
- Memory and knowledge
- A rolling summary of older messages, and a knowledge base on Pinecone, later ChromaDB with queued uploads.
- Tool safety
- 499 tools from 27 servers, each marked read, write, or moves money.
Design
What I did
- 2024: a chat layer that turns plain requests into actions for 11 crypto agents: transfer, swap, bridge, new wallets, lending, restaking, Solv BTC, airdrop accounts, price prediction, and a "degen" agent that buys memecoins on Solana by name or address. Built with TypeChat, so every reply comes back as a typed action
- 2024: much of the year went into Diviner, for Solana memecoins: paste a token's address and get a reading that mixes market data with a fortune-teller's voice, in English or Chinese
- The streaming chat API: replies over SSE, a route that carries on after a tool runs, and saved history. Git blame credits me with 1,203 of the 2,049 lines in the chat router
- The MCP client layer in the web app, on the official MCP SDK: connect to every server a user switched on, list its tools, and read the streamed events
- Added MCP's new Streamable HTTP transport next to SSE in May 2025, soon after it joined the spec
- Human-in-the-loop tools: the model asks for a tool, the user approves once or for the session, and the result goes back to the model. Plus tool toggles, custom MCP servers, chat history and a stop button
- A checker step that ends tool loops: after each result, a strict-format call decides whether the task is done, failed or still going
- Moved chat to OpenRouter and Claude, then to many models: tools formatted per provider, a fixer for broken tool schemas, and a picker with 14 models
- Conversation memory: the last 15 messages stay as they are, and older ones fold into a summary that remembers which tools ran
- Built the knowledge base three times: local embeddings, then a Pinecone service with reranking, then ChromaDB with chunking and queued uploads
- A dynamic MCP list: the system prompt is built from the database, and when the assistant lacks a tool it tells the user which MCP to switch on
- Risk levels for 499 MCP tools from 27 servers: read, write, or moves money. A script suggests a level, a person reviews it, and a script imports it
- The AP2 and x402 payments demo on BNB Chain, with mandates signed in MetaMask (it has its own page, under Related)
- Chat linked to the trading Task Manager: 12 AI actions to apply, start, pause and stop strategies and read their logs
- Built features from the TermiX designer's designs, including Diviner: paste a token's address and get its reading, in English or Chinese
- Smaller work: admin dashboards, AI signal cards in the trading app built on a teammate's components, and landing page sections
What was new
- Typed AI output in 2024: a schema the model must fill, so a chat message becomes an exact blockchain action
- My first production MCP work, and moving to Streamable HTTP within weeks of it being released
- Streaming tool calls with a human approval step before anything runs
- Search-based knowledge (RAG) built three ways, with three different stacks
- Risk levels as a safety layer for an agent that can move money
Problems I hit, and how I fixed them
Browsers blocked calls to MCP servers (CORS).
Fix Moved list and call behind server routes, with a token fetched for each server.
The agent kept calling tools in a loop.
Fix A checker call with a strict format decides done, error or pending after each result.
Claude rejected our tool names, because they contained ":".
Fix Encode ":" on the way out and decode it on the way back.
Some MCP tool schemas mixed types with no item schema, and OpenAI-format tool calls broke.
Fix A schema fixer that rewrites them into a valid shape.
Long chats filled the context window.
Fix Keep the last 15 messages and summarise the rest.
ChromaDB scores came out negative, because the code assumed cosine distance and Chroma uses L2.
Fix Convert distance to a score correctly and lower the threshold.
Timeline
- Jan–Mar 2024Backend work at Metaline, the team that became TermiX.
- Jun–Sep 2024First AI agents: a typed chat layer routing requests to 11 crypto agents, memecoin buying included.
- 2024Diviner, a reading tool for Solana memecoins.
- Apr 2025First chat API. Chat and tools working together two days later.
- May 2025Streamable HTTP transport. Moved to OpenRouter and Claude.
- Jun 2025Knowledge base v1, conversation memory, the Pinecone service.
- Jul 2025Many-model support.
- Oct 2025AP2 payments demo.
- Nov 2025Risk levels for MCP tools. Queued knowledge-base uploads.
- Jan–Feb 2026Admin dashboards and AI signals in the trading app.
Screenshots
Screenshots in the works
Real screens from TermiX go here.
To be clear
Diviner's code lives in TermiX's private repos, so I can't link it. Some of the 2025 work stayed on branches and never shipped: an agent-to-agent (A2A) prototype, an x402 payment mode and a website importer for the knowledge base. TermiX won 1st place (Innovation) at BNB Chain's Zero2Hero hackathon in June 2023, before I joined. During my time we placed 3rd in the Dego.Finance track of the BNB Chain Q3 2024 hackathon.