basic-fns-mcp

basic-fns-mcp

Provides core filesystem, shell, search, and listing tools with a path sandbox, supporting HTTP and stdio transports.

Category
Visit Server

README

basic-fns-mcp

A streamable-HTTP/stdio MCP server exposing the core filesystem, shell, search, and listing tools that mirror the default agent toolset.

Tools

Tool Hint Purpose
read readOnly Read a text file with cat-style line numbers
write destructive Create or overwrite a file atomically
edit destructive Targeted string replacement in a text file
bash destructive Execute a shell command and capture output/exit code
grep readOnly Search file contents by regex (uses rg --no-ignore if available, with a Python fallback)
find readOnly Find files/directories by glob-style name match
ls readOnly List directory contents

All filesystem paths are resolved relative to the configured server root. The server refuses any path that resolves outside that root, including symlinks that escape it.

Quick start

Install and run over HTTP:

uv sync
uv run basic-fns-mcp --root . --port 8080

Add it to Claude Code:

claude mcp add --transport http basic-fns http://127.0.0.1:8080/mcp

stdio

The same server runs over stdio, where the client spawns it as a subprocess:

uv run basic-fns-mcp --stdio            # or: --transport stdio

Add it to Claude Code:

claude mcp add basic-fns -- uv run --directory /path/to/basic-fns-mcp basic-fns-mcp --stdio

Or in an MCP client config file:

{
  "mcpServers": {
    "basic-fns": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/basic-fns-mcp", "basic-fns-mcp", "--stdio"],
      "env": { "BASIC_FNS_ROOT": "/path/to/your/project" }
    }
  }
}

On stdio, stdout is the protocol channel — the startup banner is suppressed and all logging goes to stderr. The --host/--port flags are ignored.

The module can also be served directly, since tools are registered at import time:

uv run fastmcp run src/basic_fns_mcp/server.py

CLI flags / environment variables

Flag Environment variable Default Meaning
--root BASIC_FNS_ROOT current working directory Sandbox root; all paths resolve under it
--host BASIC_FNS_HOST 127.0.0.1 HTTP bind address
--port BASIC_FNS_PORT 8080 HTTP bind port
--max-read-bytes BASIC_FNS_MAX_READ_BYTES 2_000_000 Refuse read for files larger than this
--max-output-chars BASIC_FNS_MAX_OUTPUT 100_000 Cap any tool result to this length
--bash-timeout BASIC_FNS_BASH_TIMEOUT 120 Default shell timeout in seconds
--read-only BASIC_FNS_READ_ONLY false Disable write and edit
--no-bash BASIC_FNS_ALLOW_BASH true Do not register the bash tool
--transport / --stdio BASIC_FNS_TRANSPORT http http or stdio

Command-line arguments win over environment variables.

Security

  • Path sandbox: read, write, edit, grep, find, and ls resolve every path inside --root. Symlinks are followed and checked; any path that resolves outside the root is rejected.
  • bash is not sandboxed: bash runs with the full privileges of the server process. A shell command can cd anywhere, read any file the server user can read, and execute arbitrary code. Only bind to loopback (127.0.0.1) and expose this server to trusted clients.
  • No command blocklist: Blocklists are easily bypassed and create a false sense of security, so none is implemented.
  • Read-only mode: Use --read-only to prevent file modification via this server.

Development

Run the test suite:

uv run pytest -q

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured