MCP Filesystem Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Filesystem Serverlist all files in the src directory"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Filesystem Server & AI Orchestrator
A TypeScript-based Model Context Protocol (MCP) project featuring a lightweight filesystem server and an interactive AI agent that can read, write, search, and list files through natural language conversation.
ποΈ Architecture
This project consists of two main components communicating via the MCP protocol:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β AI Orchestrator β
β (src/orchestrator.ts) β
β β
β ββββββββββββ ββββββββββββ βββββββββββββββββββ β
β β User ββββΆβ OpenAI ββββΆβ MCP Client β β
β β Input β β (LLM) β β (Stdio) β β
β ββββββββββββ ββββββ¬ββββββ ββββββββββ¬βββββββββ β
β β² β β β
β β tool calls tool results β
β β & responses β β
β ββββββ΄βββββ β β
β β Output β βΌ β
β βββββββββββ ββββββββββββββββ β
β β β β
β ββββββββββββββββββββββββ β
β β MCP Filesystem ββ β
β β Server ββ β
β β (src/index.ts) ββ β
β β ββ β
β β β’ list_files ββ β
β β β’ read_file ββ β
β β β’ write_file ββ β
β β β’ search_files ββ β
β ββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββπ¦ Tech Stack
Technology | Purpose |
TypeScript | Language |
tsx | Run TypeScript directly (no build step) |
Node.js | Runtime |
@modelcontextprotocol/sdk | MCP protocol implementation |
OpenAI SDK | LLM communication via OpenRouter |
zod | Runtime validation |
dotenv | Environment variable management |
π§ Components
1. MCP Server β src/index.ts
A filesystem tool server that exposes 4 tools over MCP via stdio transport:
Tool | Description | Parameters |
| List files in a directory |
|
| Read contents of a file |
|
| Write content to a file |
|
| Search files containing specific text |
|
2. Orchestrator / AI Agent β src/orchestrator.ts
An interactive AI agent that:
Connects to the MCP server (spawns it as a child process)
Dynamically fetches available tools from the server
Accepts natural language user input via a REPL interface
Sends prompts to the OpenAI-compatible LLM (
inclusionai/ring-2.6-1t:freevia OpenRouter)Detects tool call requests in the model's response
Executes the corresponding MCP tools on the server
Feeds tool results back to the model for continued reasoning
Outputs the final natural language answer
π Interaction Flow
User Input
β
βΌ
ββββββββββββββββ
β OpenAI LLM β (via OpenRouter)
β (Reasoning) β
ββββββββ¬ββββββββ
β
βββββ΄βββββββββ
β Tool Call? β
βββββ¬βββββββββ
Yes β No
βΌ βΌ
ββββββββββββββ ββββββββββββββββ
β MCP Server β β Final Answerβ
β (File Ops) β β β User β
βββββββ¬βββββββ ββββββββββββββββ
β
βΌ
Tool Result
β
βΌ
Feed back to LLM β Continue reasoning or finalizeβ‘ Quick Start
Prerequisites
Node.js (v18+ recommended)
npm
An OpenRouter API key (get one at openrouter.ai)
Setup
Clone the repository
git clone <repo-url> cd mcpInstall dependencies
npm installConfigure environment variables
cp sample-env .env # Edit .env and add your OpenRouter API key: # OPENROUTER_API_KEY=your_key_hereStart the MCP Server (optional β orchestrator spawns it automatically)
npm run devRun the Orchestrator
npm run orchestratorInteract with the agent β Type natural language commands like:
"List all files in the src directory"
"Read the contents of package.json"
"Write a hello world message to a new file"
"Search for 'import' in the src folder"
Type
exitto quit
π Project Structure
.
βββ .env # OpenRouter API key (not committed)
βββ .gitignore # Git ignore rules
βββ package.json # Node.js project configuration
βββ package-lock.json # Dependency lock file
βββ sample-env # Environment variable template
βββ tsconfig.json # TypeScript compiler options
βββ README.md # This file
βββ src/
βββ index.ts # MCP Server β filesystem tools
βββ orchestrator.ts # AI Agent β MCP client & prompt loopπ Notes
Model: The orchestrator uses
inclusionai/ring-2.6-1t:freevia OpenRouter. This can be changed insrc/orchestrator.tsby modifying themodelfield in thechat.completions.create()call.Transport: Both server and client communicate over stdio (
StdioServerTransport/StdioClientTransport), which is the simplest MCP transport method.Security: This is a demo project. In production, you'd want proper error handling, input validation, security boundaries on file access, and potentially a different transport method (e.g., SSE or HTTP).
π References
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/midsane/mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server