Menu

How We Made Stateful MCP Servers Work in One-Shot CLI Calls
πŸ“°
0

How We Made Stateful MCP Servers Work in One-Shot CLI Calls

DEV CommunityΒ·Javier Leandro ArancibiaΒ·about 1 month ago
#GwOQUDBa
#cli#javascript#node#daemon#context#fullscreen
Reading 0:00
15s threshold

How We Made Stateful MCP Servers Work in One-Shot CLI Calls The Problem: Stateful Servers vs Stateless CLI Context-mode is a powerful MCP (Model Context Protocol) server that maintains a SQLite knowledge base and session history. It reduces AI context window usage by up to 98% by keeping raw tool output out of conversations and only returning relevant snippets. But there was a problem: context-mode is stateful . It needs to stay alive between calls to maintain its knowledge base. Traditional CLI tools are stateless β€” each invocation is a fresh process. When we tried to integrate context-mode into supercli (a CLI wrapper for external tools), we hit a wall: # Call 1: Index project structure sc mcp call --mcp-server context-mode --tool ctx_index --input-json '{"content":"..."}' # Call 2: Search β€” but knowledge is gone! New process, new database.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More