Time Complexity MCP: Static Analysis Tool Feeds Big-O Complexity to AI Coding Agents

Time Complexity MCP is an MCP server that performs static analysis on code to determine Big-O time complexity, then feeds those values directly to AI coding agents. The tool bypasses the token consumption and potential inaccuracies that occur when frontier models attempt to analyze complexity themselves.
How It Works
The server parses code into Abstract Syntax Trees (ASTs) using tree-sitter, then analyzes them to detect:
- Loop nesting patterns
- Recursion patterns
- Known standard library costs
It reports per-function Big-O complexity with line annotations that AI agents can access as a tool.
What It Detects
The tool identifies specific complexity patterns:
.contains()inside aforloop → O(n²).sort()with.indexOf()in the comparator → O(n² log n)- Branching recursion like fibonacci → O(2ⁿ)
- Constant-bound loops like
for i in range(10)→ O(1)
Supported Languages
The tool currently supports JavaScript, TypeScript, Python, Java, Kotlin, and Dart.
Real-World Application
The developer ran the tool on its own codebase and found:
- O(n³) in the directory scanner
- O(n²) in the formatting utils
These issues were fixed based on the tool's own report, demonstrating practical self-improvement.
Availability
Time Complexity MCP is open source with prebuilt releases available at https://github.com/Luzgan/time-complexity-mcp.
📖 Read the full source: r/ClaudeAI
👀 See Also

Lemonade by AMD: Open Source Local LLM Server for GPU and NPU
Lemonade is an open source local AI server that runs text, image, and speech models on GPUs and NPUs. It's OpenAI API compatible, supports multiple models simultaneously, and has a 2MB native C++ backend.

Dynamic Status Bar for Claude Code Shows Live Updates
A developer has improved their Claude Code status bar from static text to dynamic display with real-time updates showing what Claude is working on. The configuration is available as a GitHub gist.

OpenClaw CoreBrain Plugin: Persistent Memory for AI Coding Agents
A new plugin called CoreBrain addresses OpenClaw's memory issues by storing information outside the context window in a knowledge graph and auto-injecting it before every query, eliminating the need for tool calls and optional memory invocation.

Troubleshooting Email and Google Drive Access for AI Agents
Setting up email and Google Drive access for AI bots on AWS can trigger account blocks. Here's a solution using Gmail and Workspace domains.