my-mcp-server
Click on "Deploy 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., "@my-mcp-serverecho 'hello world' to test"
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.
My MCP Server (for Beginners)
A self-made MCP (Model Context Protocol) Server with:
Your own API key & URL module via the
.envfileExample tools:
echoandcall_my_apiReady to test with MCP Inspector
Ready to use directly in VS Code (GitHub Copilot Chat)
1. Install dependencies
npm installRelated MCP server: mcp-server-demo
2. Create the .env file
Copy .env.example to .env, then fill it in with your own API key and URL:
Copy-Item .env.example .envFill in .env:
MY_API_KEY=api-key-asli-kamu
MY_API_BASE_URL=https://api.contohkamu.com
MCP_SERVER_NAME=my-mcp-server⚠️ Never commit the
.envfile to git. This file is already automatically ignored via.gitignore.
3. Build the project
npm run buildThis command compiles the TypeScript in src/ into JavaScript in build/.
4. Test with MCP Inspector
MCP Inspector is a visual (browser) tool for trying out your MCP tools without needing another client.
npm run inspectorThis will run npx @modelcontextprotocol/inspector node build/index.js and open the Inspector in the browser. From there you can:
Click the Tools tab
Select the
echoorcall_my_apitoolFill in the parameters, click Run Tool, and see the results
5. Use directly in VS Code
The .vscode/mcp.json file is already prepared. Open the Command Palette → MCP: List Servers → select my-mcp-server → Start Server. This server automatically reads .env via envFile.
Project Structure
├── .env # rahasia kamu (tidak di-commit)
├── .env.example # contoh isi .env
├── .vscode/mcp.json # konfigurasi MCP untuk VS Code
├── src/
│ ├── config.ts # loader environment variable
│ ├── apiClient.ts # modul pemanggilan API eksternal (pakai API key & URL)
│ └── index.ts # server MCP utama + daftar tool
├── package.json
└── tsconfig.jsonAdding a new tool
Add a new server.registerTool("nama_tool", { ... }, async (input) => { ... }) block in src/index.ts, then run npm run build again.
Troubleshooting
Error "Environment variable ... not set yet" → make sure
.envexists and is filled in.Tool
call_my_apifails → check whetherMY_API_BASE_URLandMY_API_KEYare correct, and that the API endpoint supports theAuthorization: Bearer <key>header.Inspector does not open → make sure you have run
npm run buildfirst.
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP for 1,500+ APIs. Vault-managed credentials; OAuth or API key. Search, load, and execute.
Give any MCP-compatible AI assistant a builder for live, hosted web tools and workflows.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables users to expose arbitrary HTTP APIs as configurable MCP tools by defining tool specifications in a JSON configuration file.2,323 npm3-
- FlicenseNot gradedqualityDmaintenanceEnables AI clients to connect to example tools, resources, and prompts over MCP, demonstrating integration with IDEs, chatbots, and agent frameworks.-
- FlicenseNot gradedqualityCmaintenanceEnables MCP clients to search GitHub repositories and users, retrieve weather data and forecasts, and access NASA astronomy and image data through modular MCP tools.-
- AlicenseNot gradedqualityCmaintenanceEnables interaction with Infor systems by exposing verified HTTP/SOAP requests as MCP tools, supporting multiple services, configurable authentication, and extensible request definitions.Apache 2.0