streamline-mcp
v0.1.0
Published
Streamline: The intelligent model optimizer and execution engine for MCP
Downloads
104
Maintainers
Readme
Streamline MCP
An MCP server to optimize LLM usage for coding agents. It provides tools to parse plans, estimate costs, recommend model strategies, and execute work units via LiteLLM.
Overview
Streamline helps you optimize your LLM usage by parsing plans, estimating costs across models, recommending the best strategy (Premium vs. Cheap vs. Mixed), and optionally executing the plan via LiteLLM.
Setup
Install Dependencies:
npm installConfigure Models: Edit
config/models.yamlto define your available models and pricing.Configure Policies: Edit
config/policies.yamlto set budget limits and risk tolerance.Environment Variables: Create a
.envfile with:LITELLM_BASE_URL=http://localhost:4000 LITELLM_API_KEY=sk-1234 # Optional if LiteLLM requires itBuild:
npm run build
Usage via MCP
The server provides 4 main tools:
- parse_plan: Converts markdown plan text into structured work units.
- preflight_compare: Estimates token usage and cost for a given plan across suitable models.
- recommend_strategy: Suggests "All Premium", "All Cheap", or "Mixed" strategies based on cost/performance trade-offs.
- run_strategy: Executes a chosen strategy, logging costs and outcomes to a local SQLite database.
Running the Server
Run via node:
node dist/index.jsOr configure in your MCP client (Antigravity settings):
{
"mcpServers": {
"streamline": {
"command": "npx",
"args": ["-y", "streamline-mcp"],
"env": {
"LITELLM_BASE_URL": "http://localhost:4000"
}
}
}
}UI / Reporting
To visualize run history and cost metrics, generate a local HTML report:
npm run generate-reportThis will create report.html in the root directory. Open it in any browser to see:
- Recent run statuses and costs
- Detailed step-by-step logs for the latest run
- Aggregate model success rates and efficiency metrics
Database
The server maintains a SQLite database model_optimizer.db in the working directory to track:
- Run history
- Cost vs Estimate accuracy
- Model success rates
Example Workflow
- User provides a plan in Chat.
- Antigravity calls
parse_plan(plan_text). - Antigravity calls
preflight_compare(plan_text, work_units). - Antigravity calls
recommend_strategy(...). - User selects a strategy (e.g., "Mixed").
- Antigravity calls
run_strategy(strategy_id, allocations, ...)to execute.
