Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Show HN: Scopewalker, an MCP server for codebase complexity metrics

Scopewalker is an open-source MCP server that gives AI agents eight read-only tools for codebase complexity metrics—line counts, cognitive complexity, parameter counts, doc coverage, code smells, and more. It supports TS/JS, Python, Go, Rust, Java, C/C++, and Ruby, runs locally over stdio with no network calls.

Background

- **MCP (Model Context Protocol)** is an open standard that lets AI coding assistants (like Claude Code, Cursor, VS Code's Copilot, Gemini CLI) talk to local tools and data sources — effectively giving the AI agent "read-only tools" it can invoke. - **Tree-sitter** is a parser library that can understand the syntactic structure of many programming languages; **tokei** counts lines of code; **fast-glob** finds files matching patterns — all three are used under the hood so the tool doesn't need custom parsing. - The problem this solves: AI coding agents commonly generate bloated code (huge files, functions with too many parameters, deeply nested logic) even when the developer has written rules against it, because the agent has no way to *measure* the complexity itself. - **Cognitive complexity** (pioneered by SonarSource) measures how hard code is for a human to understand — it penalizes deep nesting, long chains of logic, etc., unlike raw line count.

Related stories

  • Safari Technology Preview 247 introduces the Safari MCP server, a Model Context Protocol server that lets AI agents connect to a Safari browser window to access DOM, network requests, screenshots, and console output for more autonomous web debugging and development.