@@ -62,7 +62,8 @@ This is an MCP (Model Context Protocol) server that provides precise code extrac
6262- ** Data Models** (` models.py ` ) - Rich symbol representations with hierarchical relationships
6363- ** Language Support** (` languages.py ` ) - Detection and mapping for 30+ programming languages
6464- ** Tree-sitter Queries** (` queries/ ` ) - Language-specific syntax parsing patterns
65- - ** File Reading** (` file_reader.py ` ) - Unified file reading with VCS support
65+ - ** File Reading** (` file_reader.py ` ) - Unified file reading with VCS and URL support
66+ - ** URL Fetching** (` url_fetcher.py ` ) - HTTP fetching with caching and error handling
6667- ** VCS Support** (` vcs/ ` ) - Pluggable version control system abstraction
6768- ** Entry Points** (` __main__.py ` ) - Module execution support
6869
@@ -125,17 +126,42 @@ The server exposes 5 tools to AI assistants:
125126
126127** Best Practice** : Always use ` get_symbols ` first for code exploration, then use specific extraction tools for detailed analysis.
127128
129+ ### URL Support
130+
131+ All 5 MCP tools support URLs for fetching remote code:
132+
133+ ** Examples:**
134+ ``` python
135+ # GitHub raw URLs
136+ get_symbols(" https://raw.githubusercontent.com/user/repo/main/src/main.py" )
137+ get_function(" https://raw.githubusercontent.com/user/repo/main/src/api.py" , " handle_request" )
138+
139+ # GitLab raw URLs
140+ get_class(" https://gitlab.com/user/project/-/raw/main/src/models.py" , " User" )
141+ get_lines(" https://gitlab.com/user/project/-/raw/main/config.py" , 10 , 20 )
142+
143+ # Direct file URLs
144+ get_signature(" https://example.com/code/utils.py" , " helper_function" )
145+ ```
146+
147+ ** Features:**
148+ - Automatic content-type validation (text/* only)
149+ - File size limits (1MB default, configurable)
150+ - TTL caching for performance (5min default)
151+ - Robust error handling for network issues
152+ - Support for GitHub, GitLab, and direct file URLs
153+
128154### Git Revision Support
129155
130- All 5 MCP tools now support an optional ` git_revision ` parameter for extracting code from any git revision:
156+ All 5 MCP tools also support an optional ` git_revision ` parameter for extracting code from any git revision:
131157
132158** Examples:**
133159``` python
134160# Extract from filesystem (default, backward compatible)
135161get_symbols(" src/main.py" )
136162get_function(" src/main.py" , " process_data" )
137163
138- # Extract from git revisions
164+ # Extract from git revisions (NOT compatible with URLs)
139165get_symbols(" src/main.py" , " HEAD~1" ) # Previous commit
140166get_function(" src/main.py" , " process_data" , " feature-branch" ) # Branch
141167get_class(" src/models.py" , " User" , " v1.0.0" ) # Tagged version
@@ -156,4 +182,5 @@ get_signature("src/api.py", "handle_request", "HEAD^2") # Merge parent
156182- File must be in a git repository
157183- Git command must be available in PATH
158184- Revision must exist in the repository
159- - File must exist at the specified revision
185+ - File must exist at the specified revision
186+ - ** Note** : ` git_revision ` parameter is NOT supported when using URLs
0 commit comments