From the creator of Agent Toolbelt (1,600+ weekly npm downloads)
Learn to build, package, and publish Model Context Protocol tools that AI agents actually use. 7 modules. 33 lessons. Ship a real npm package by the end.
This is a complete MCP server. You'll build one in Module 1.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
const server = new McpServer({
name: "stock-tools",
version: "1.0.0",
});
server.tool(
"get_stock_quote",
"Get the latest price for a stock ticker",
{ ticker: z.string().describe("Stock ticker symbol") },
async ({ ticker }) => {
const res = await fetch(
`https://api.polygon.io/v2/aggs/ticker/${ticker}/prev`
);
const data = await res.json();
return {
content: [{
type: "text",
text: JSON.stringify(data.results[0], null, 2),
}],
};
}
);
const transport = new StdioServerTransport();
await server.connect(transport);Early bird pricing. 50 spots at $29.
Get the Course — $29Full price $79 after early bird sells out