mcpField
M
mcp-server-filesystem

mcp-server-filesystem

Local
github.com/bytedanceFiles & Storage39.4kUpdated 3w ago

About mcp-server-filesystem

FileSystem MCP Server is an MCP server that provides filesystem operations. It runs on Node.js via npx and works with MCP clients such as VS Code, Cursor, Windsurf and Claude Desktop.

Key features

  1. 01Local stdio server started with npx
  2. 02Remote SSE and Streamable HTTP endpoints
  3. 03Directory access limited by allowed-directories option
  4. 04In-process usage from JavaScript or TypeScript projects

Use cases

  1. 01Letting an AI assistant read and write files in a local project
  2. 02Adding file access to Cursor or Claude Desktop

MCP support

This project is an MCP server that exposes filesystem operations to MCP clients. Clients can connect over stdio, SSE or Streamable HTTP.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"bytedance-mcp-server-filesystem": {
"command": "npx",
"args": [
"-y",
"@agent-infra/mcp-server-filesystem"
]
}
}
}
Run commandnpx -y @agent-infra/mcp-server-filesystem

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@agent-infra/mcp-server-filesystemlatest

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

FileSystem MCP Server

NPM Downloads

Install MCP Server Install in VS Code Install in VS Code Insiders

A Model Context Protocol (MCP) server that provides filesystem operations.

README image

Requirements
  • Node.js 18 or newer
  • VS Code, Cursor, Windsurf, Claude Desktop or any other MCP client
Getting started
Local (Stdio)

First, install the Filesystem MCP server with your client. A typical configuration looks like this:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "@agent-infra/mcp-server-filesystem@latest"
      ]
    }
  }
}
Install in VS Code

You can also install the Filesystem MCP server using the VS Code CLI:

# For VS Code
code --add-mcp '{"name":"filesystem","command":"npx","args":["@agent-infra/mcp-server-filesystem@latest"]}'

After installation, the Filesystem MCP server will be available for use with your GitHub Copilot agent in VS Code.

Install in Cursor

Go to Cursor Settings -> MCP -> Add new MCP Server. Name to your liking, use command type with the command npx @agent-infra/mcp-server-filesystem. You can also verify config or add command like arguments via clicking Edit.

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "@agent-infra/mcp-server-filesystem@latest",
        "--allowed-directories /tmp"
      ]
    }
  }
}
Install in Windsurf

Follow Windsuff MCP documentation. Use following configuration:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "@agent-infra/mcp-server-filesystem@latest",
        "--allowed-directories /tmp"
      ]
    }
  }
}
Install in Claude Desktop

Follow the MCP install guide, use following configuration:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": [
        "@agent-infra/mcp-server-filesystem@latest",
        "--allowed-directories /tmp"
      ]
    }
  }
}
Remote (SSE / Streamable HTTP)

At the same time, use --port $your_port arg to start the browser mcp can be converted into SSE and Streamable HTTP Server.

# normal run remote mcp server
npx @agent-infra/mcp-server-filesystem --port 8089 --allowed-directories <dir>

You can use one of the two MCP Server remote endpoint:

  • Streamable HTTP(Recommended): http://127.0.0.1::8089/mcp
  • SSE: http://127.0.0.1::8089/sse

And then in MCP client config, set the url to the SSE endpoint:

{
  "mcpServers": {
    "filesystem": {
      "url": "http://127.0.0.1::8089/sse"
    }
  }
}

url to the Streamable HTTP:

{
  "mcpServers": {
    "filesystem": {
      "type": "streamable-http", // If there is MCP Client support
      "url": "http://127.0.0.1::8089/mcp"
    }
  }
}
In-memory call

If your MCP Client is developed based on JavaScript / TypeScript, you can directly use in-process calls to avoid requiring your users to install the command-line interface to use Filesystem MCP.

import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { InMemoryTransport } from '@modelcontextprotocol/sdk/inMemory.js';

// type: module project usage
import { createServer } from '@agent-infra/mcp-server-filesystem';
// commonjs project usage
// const { createServer } = await import('@agent-infra/mcp-server-filesystem')

const client = new Client(
  {
    name: 'test filesystem client',
    version: '1.0',
  },
  {
    capabilities: {},
  },
);

const server = createServer();
const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();

await Promise.all([
  client.connect(clientTransport),
  server.connect(serverTransport),
]);

// list tools
const result = await client.listTools();
console.log(result);

// call tool
const toolResult = await client.callTool({
  name: 'list_directory',
  arguments: {
    path: '~/your_computer'
  },
});
console.log(toolResult);
Development

Access http://127.0.0.1:6274/:

npm run dev

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.