mcp-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-serverwhat's my IP address?"
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 Server — AI Tool Server
Educational project demonstrating how an AI can connect to a server to execute real actions on an operating system.
What is this project?
This project simulates an MCP Server (Model Context Protocol Server) — an HTTP server that exposes tools that an Artificial Intelligence can call remotely.
The core idea is simple: the AI does not execute commands on the operating system directly. Instead, it sends an HTTP request to this server asking for a tool to be executed. The server receives it, executes it, and returns the result.
IA → POST /tool { "tool": "get_ip" } → MCP Server → Sistema Operacional
IA ← { "success": true, "result": { "ips": [...] } } ← MCP ServerRelated MCP server: Shell Server
Project objective
Demonstrate client-server architecture applied to AI
Show how tools can be dynamically registered and selected
Serve as a learning base for larger projects
Be easy to understand, modify, and present
Stack used
Technology | Usage |
Node.js | JavaScript Runtime |
Express.js | HTTP Framework |
fs, os, path | Native Node modules |
child_process | System command execution |
Folder structure
mcp-server/
│
├── src/
│ ├── server.js ← Ponto de entrada — inicia o servidor
│ ├── routes/
│ │ └── tools.routes.js ← Define as rotas HTTP
│ ├── controllers/
│ │ └── tools.controller.js ← Valida o input e chama o serviço
│ ├── services/
│ │ └── tools.service.js ← Registry de tools + lógica de seleção
│ ├── tools/
│ │ ├── getIp.js ← Tool: retorna o IP da máquina
│ │ ├── getHostname.js ← Tool: retorna o hostname
│ │ ├── listFiles.js ← Tool: lista arquivos de um diretório
│ │ ├── createFile.js ← Tool: cria um arquivo
│ │ └── pingHost.js ← Tool: faz ping em um host
│ └── utils/
│ └── response.js ← Padroniza respostas JSON
│
├── docs/
│ ├── README.md ← Este arquivo
│ └── AI_CONTEXT.md ← Contexto arquitetural para IAs
│
├── package.json
└── .gitignoreHow to install
Prerequisite: Node.js installed (version 18 or higher recommended).
# Clone ou copie o projeto para sua máquina
cd mcp-server
# Instale as dependências
npm installHow to run
# Modo normal
npm start
# Modo desenvolvimento (reinicia ao salvar arquivos — Node 18+)
npm run devThe server will start on port 3000 by default.
To use a different port:
PORT=8080 npm startHow to verify it is working
Access via browser or curl:
curl http://localhost:3000/healthExpected response:
{ "status": "ok", "message": "MCP Server rodando" }How to use — API
There are two main endpoints: one to list tools and another to execute them.
List available tools
Returns all tools registered on the server with their complete schemas (description and parameters). This format facilitates integration with AIs (Tool Calling).
GET http://localhost:3000/toolsResponse:
{
"success": true,
"result": [
{
"name": "create_file",
"description": "Cria um arquivo dentro da pasta /files.",
"parameters": {
"type": "object",
"properties": {
"filename": { "type": "string", "description": "..." },
"content": { "type": "string", "description": "..." }
},
"required": ["filename"]
}
}
]
}Execute a tool
POST http://localhost:3000/tool
Content-Type: application/jsonRequest format
{
"tool": "nome_da_tool",
"args": {
"parametro": "valor"
}
}Available Tools
get_ip
Returns the machine's local IPs.
Request:
{ "tool": "get_ip", "args": {} }get_hostname
Returns the machine's hostname, platform, and architecture.
Request:
{ "tool": "get_hostname", "args": {} }list_files
Lists files and directories in a path. If path is omitted, it uses the current process directory.
Request:
{ "tool": "list_files", "args": { "path": "/home/user" } }create_file
Creates a file inside the /files folder at the server root. This folder acts as a sandbox to organize generated files.
Request:
{
"tool": "create_file",
"args": {
"filename": "teste.txt",
"content": "Olá, MCP!"
}
}ping_host
Pings a host or IP and returns the result. Security: Only alphanumeric characters, dots, and hyphens are allowed in the host to prevent command injection.
Request:
{ "tool": "ping_host", "args": { "host": "8.8.8.8" } }Testing with curl
# get_ip
curl -X POST http://localhost:3000/tool \
-H "Content-Type: application/json" \
-d '{"tool": "get_ip", "args": {}}'
# list_files
curl -X POST http://localhost:3000/tool \
-H "Content-Type: application/json" \
-d '{"tool": "list_files", "args": {"path": "/tmp"}}'
# create_file
curl -X POST http://localhost:3000/tool \
-H "Content-Type: application/json" \
-d '{"tool": "create_file", "args": {"filename": "ola.txt", "content": "Olá mundo!"}}'
# ping_host
curl -X POST http://localhost:3000/tool \
-H "Content-Type: application/json" \
-d '{"tool": "ping_host", "args": {"host": "8.8.8.8"}}'Full flow — AI → MCP → System
1. IA decide que precisa saber o IP da máquina
2. IA envia: POST /tool { "tool": "get_ip", "args": {} }
3. Express recebe a requisição
4. Route encaminha para o Controller
5. Controller valida o body e chama o Service
6. Service consulta o Registry e encontra a função getIp
7. getIp() usa o módulo "os" para ler as interfaces de rede
8. Resultado sobe de volta: getIp → Service → Controller → Response
9. IA recebe: { "success": true, "result": { "ips": [...] } }
10. IA usa o resultado para continuar sua tarefaPossible future improvements
Add authentication via API Key
Implement call logging (who called which tool and when)
Add WebSocket support for streaming results
Integrate with local AI models (Ollama, LM Studio)
Add new tools: CPU/memory reading, script execution, etc.
Create an example client that simulates an AI calling the tools
Security notes
This project is educational. For production use, it would be necessary to:
Implement route authentication
Whitelist paths for
list_filesandcreate_fileRate limiting
More robust input sanitization
HTTPS
Project developed for academic and demonstration purposes.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA modular MCP server providing file operations, web search, URL scraping, and sandboxed command execution for LLM interactions.1MIT
- FlicenseAqualityCmaintenanceA simple MCP server that exposes a terminal tool, allowing AI agents to execute shell commands.1
- AlicenseNot gradedqualityCmaintenanceA self-hosted MCP server that gives AI agents controlled access to a machine: filesystem, shell, background processes, git, web fetching and persistent key-value memory.GPL 3.0
- FlicenseBqualityCmaintenanceA lightweight MCP server that enables AI assistants to interact with the local machine through terminal, filesystem, and Python execution tools.91
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server exposing the Backtest360 engine API as tools for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Gagocode/mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server