1.1.9 • Published 4 months ago

@agent-infra/mcp-server-filesystem v1.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

FileSystem MCP Server

NPM Downloads

Install MCP Server

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

npm.io

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"
      ]
    }
  }
}

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.

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"
      ]
    }
  }
}

Follow Windsuff MCP documentation. Use following configuration:

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

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);

Developement

Access http://127.0.0.1:6274/:

npm run dev
1.1.9

4 months ago

1.1.8

4 months ago

1.1.7

4 months ago

1.1.6

5 months ago

1.1.6-beta.10

5 months ago

1.1.6-beta.9

5 months ago

1.1.6-beta.8

5 months ago

1.1.6-beta.7

5 months ago

1.1.6-beta.6

5 months ago

1.1.6-beta.5

5 months ago

1.1.6-beta.4

5 months ago

1.1.6-beta.3

5 months ago

1.1.6-beta.0

5 months ago

1.1.6-beta.2

5 months ago

1.1.6-beta.1

5 months ago

1.1.5

5 months ago

1.1.4

5 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.1

5 months ago

1.1.1-beta.3

5 months ago

1.1.1-beta.2

5 months ago

1.1.1-beta.1

5 months ago

1.1.1-beta.0

5 months ago

1.1.0

5 months ago

1.0.1-beta.15

5 months ago

1.0.1-beta.14

5 months ago

1.0.1-beta.13

5 months ago

1.0.1-beta.12

5 months ago

1.0.1-beta.11

5 months ago

1.0.1-beta.10

5 months ago

1.0.1-beta.9

5 months ago

1.0.1-beta.8

5 months ago

1.0.1-beta.7

5 months ago

0.0.1

7 months ago