ctoth

MCP Server Code Extractor β€” AI skill for Claude Code

AI community

🎯 Precise code extraction for AI assistants - MCP server using tree-sitter to extract functions, classes & snippets from 30+ languages without manual parsing.

How to install MCP Server Code Extractor

This entry records only its repository, not the path inside it, so there is no exact command to give. Open ctoth/mcp_server_code_extractor and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What MCP Server Code Extractor does

🎯 Precise code extraction for AI assistants - MCP server using tree-sitter to extract functions, classes & snippets from 30+ languages without manual parsing.

Alternatives in AI

  • Jcodemunch MCP β€” Cut AI token costs 95%+ on code exploration 2.6k β˜…
  • Auto Re Agent β€” Open-source AI reverse-engineering agent using Ghidra and LLMs to reconstruct and validate C/C++ functions fro 1.4k β˜…
  • Codeseek β€” Rust-powered code intelligence CLI for AI coding agents 764 β˜…

README

MCP Server Code Extractor

A Model Context Protocol (MCP) server that provides precise code extraction tools using tree-sitter parsing. Extract functions, classes, and code snippets from 30+ programming languages without manual parsing.

Why MCP Server Code Extractor?

When working with AI coding assistants like Claude, you often need to:

  • Extract specific functions or classes from large codebases
  • Get an overview of what's in a file without reading the entire thing
  • Retrieve precise code snippets with accurate line numbers
  • Avoid manual parsing and grep/sed/awk gymnastics

MCP Server Code Extractor solves these problems by providing structured, tree-sitter-powered code extraction tools directly within your AI assistant.

Features

  • 🎯 Precise Extraction: Uses tree-sitter parsing for accurate code boundary detection
  • πŸ” Semantic Search: Search for function calls and code patterns across files and directories
  • 🌍 30+ Languages: Supports Python, JavaScript, TypeScript, Go, Rust, Java, C/C++, and many more
  • πŸ“ Line Numbers: Every extraction includes precise line number information
  • πŸ—‚οΈ Directory Search: Search entire codebases with file pattern filtering and exclusions
  • πŸ“Š Depth Control: Extract at different levels (top-level only, classes+methods, everything)
  • 🌐 URL Support: Fetch and extract code from GitHub, GitLab, and direct file URLs
  • πŸ”„ Git Integration: Extract code from any git revision, branch, or tag
  • ⚑ Fast & Lightweight: Efficient caching and minimal dependencies
  • πŸ€– AI-Optimized: Designed specifically for use with AI coding assistants

Installation

Quick Start with uvx (Recommended)

# Install and run directly with uvx
uvx mcp-server-code-extractor

Alternative Installation Methods

Using UV

# Install UV if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Run as package with UV
uv run mcp-serv