What You’ll Build
A simple MCP server with one tool that you can deploy and register on the Context Marketplace. No external API keys required.Already have an API you want to unbundle? Skip to the AI-Assisted Builder section in the Build & List guide for a faster workflow using Cursor or Claude.
Prerequisites
Before starting, ensure you have:- Node.js 18+ — Check with
node --version - pnpm (recommended) — Install with
npm install -g pnpm - A code editor — VS Code, Cursor, etc.
Step 1: Create Your Project
Open your terminal and run these commands:tsconfig.json:
package.json to add the start script:
Step 2: Write Your MCP Server (Without Security)
We’ll build the server without the security middleware first so you can test everything locally. You’ll add security before deploying. Createserver.ts:
Step 3: Test Locally
Start your server:sessionId from the response.
Test tools/call (execute your tool):
Step 4: Add Security Middleware
Before deploying, you must add the Context security middleware. This ensures only paid requests from the Context Platform can execute your tools. Update yourserver.ts:
Step 5: Deploy to Railway
Deploy on Railway
- Go to railway.app and sign in with GitHub
- Click “New Project” → “Deploy from GitHub repo”
- Select your
my-first-mcprepository - Railway auto-detects Node.js and deploys
Configure Start Command
In Railway dashboard:
- Go to your service Settings
- Set Start Command to:
pnpm start - Railway will redeploy automatically
Step 6: Register on Context Marketplace
Go to Contribute Page
Navigate to ctxprotocol.com/contribute
Fill in the Form
| Field | Value |
|---|---|
| Name | My First MCP (or your preferred name) |
| Description | Random inspirational quotes for motivation and daily inspiration. |
| Category | Utility |
| Price | $0.00 (start free to test) |
| Endpoint | https://YOUR-RAILWAY-URL.up.railway.app/mcp |
Auto-Discovery
Click submit. Context will call your
/mcp endpoint to discover your tools via listTools().Step 7: Verify It Works
- Go to ctxprotocol.com
- In the chat, ask: “Get me an inspirational quote”
- The agent should discover and use your tool!
Updating Your Tool
When you add new endpoints or modify your MCP server, you need to refresh the tool listing on Context.Refresh Skills
- Go to ctxprotocol.com/developer/tools
- Find your tool and click “Refresh Skills”
- Context will re-call
listTools()to discover your new/updated tools
Update Description (Optional)
If you’ve added significant new functionality:
- Use the MCP Server Analysis Prompt to generate an updated description
- Edit your tool’s description in the Developer Tools page
What’s Next?
Add Real Data
Connect to external APIs and build valuable tools
AI-Assisted Builder
Use Cursor or Claude to build complex MCP servers from API docs
Context Injection
Access user portfolio data in your tools
Handshake Architecture
Enable signatures, transactions, and OAuth
Troubleshooting
For a complete list of common errors and solutions, see the Troubleshooting Guide.
{"error":"Unauthorized"} when calling tools
{"error":"Unauthorized"} when calling tools
Server won't start
Server won't start
- Check Node.js version:
node --version(must be 18+) - Ensure all dependencies installed:
pnpm install - Check for TypeScript errors:
pnpm exec tsc --noEmit
Railway deployment fails
Railway deployment fails
- Ensure
package.jsonhas"type": "module" - Check Railway logs for specific errors
- Verify start command is
pnpm start
Tool not discovered on Context
Tool not discovered on Context
- Verify your
/healthendpoint returns 200 - Test
initializeandtools/listwith curl (these don’t require auth) - Ensure HTTPS URL — HTTP endpoints will not work

