G4f MCP Server
G4f exposes 17 public tools on this MCP endpoint.
- Host
- mcp.g4f.space
- Tools
- 17
- Connection URL
- https://mcp.g4f.space/mcp
Tools
web_search
Search the web for information using DuckDuckGo. Returns search results with titles, URLs, and snippets.
image_generation
Generate images from text prompts using AI image generation providers. Returns a URL to the generated image.
text_to_audio
Generate an audio URL from a text prompt using Pollinations AI text-to-speech service. Returns a direct URL to the generated audio file.
mark_it_down
Convert a URL to markdown format using MarkItDown. Supports HTTP/HTTPS URLs and returns formatted markdown content.
python_execute
Execute a Python code snippet safely. Only whitelisted modules may be imported (math, json, re, datetime, asyncio, aiohttp, g4f, …). File access is restricted to the ~/.g4f/workspace directory. Assign the value you want back to a variable named 'result'. Returns stdout, stderr, and the value of 'result'.
apply_patch
Apply a unified diff patch to a target file or directory using the system 'patch' command. Provide the target path, patch content, and optional parameters for strip level, backup, and dry run. Returns success status, output from the patch command, and any error messages.
file_read
Read the text content of a file inside the ~/.g4f/workspace directory. Provide a relative path from the workspace root. Optionally specify startLine and endLine (1-based) to read only a range of lines.
file_list
List files and directories inside the ~/.g4f/workspace directory. Optionally provide a subdirectory path relative to the workspace root. Returns names, types, and sizes.
file_delete
Delete a file from the ~/.g4f/workspace directory. Provide a relative path from the workspace root. Only files can be deleted; directories are not removed.
create_file
Create a new file in the ~/.g4f/workspace with the specified content. The directory will be created if it does not already exist. Never use this tool to edit a file that already exists.
file_write
Write text content to a file inside the ~/.g4f/workspace directory. Creates parent directories as needed. Overwrites the file if it already exists. Provide a relative path from the workspace root and the content to write.
replace_string_in_file
Replace an exact string in a file inside the ~/.g4f/workspace directory. Provide the relative file path, the exact old string, and the new string. Only the first occurrence is replaced. Returns whether a replacement was made.
fetch_webpage
Fetches the main content from web pages. Useful for summarizing or analyzing webpage content. Provide one or more URLs and a query describing what content to find.
file_search_glob
Search for files in the ~/.g4f/workspace by glob pattern. Returns the paths of matching files. Examples: **/*.py to match all Python files; src/** to match all files under src/.
grep_search
Do a fast text search in the ~/.g4f/workspace files. Supports exact string or regex patterns. Use includePattern to restrict to specific file types. Returns matching file paths and line snippets.
github_repo
Searches a GitHub repository for relevant source code snippets. Only use this tool if the user is clearly asking for code from a specific GitHub repository. Do not use for repos the user has open locally.
github_text_search
Lexically searches a GitHub repository or organization for files containing specific keywords or code patterns. Use 'owner/repo' to search a single repository or an org name (no slash) to search across an entire organization. Unlike semantic search, this uses keyword matching.
Use in your AI tool
One-click into Claude, Cursor, VS Code, and more — connects straight to this server’s public endpoint.
https://mcp.g4f.space/mcp