Running Model Context Protocol locally
Use this page to run the extracted TypeScript MCP server and try its weather tool and resource in MCP Inspector. The server communicates with its client through standard input and output, so it waits for a client instead of opening a project page or application port.
What you need first
Install Node 24. MCP Inspector sets a minimum Node version (22.19 at the time of writing); Node 24 is above that minimum, while an older LTS release may not start the testing UI.
This project does not require an API key or .env file. MCP clients launch the server as a child process, so the Node version and environment it runs with come from whatever launches it on your machine.
.env file. The one surprise is that this server never opens a web page; it waits quietly for a client, which fooled me completely the first time I ran one. Install and repair the server
Open a terminal in the extracted server folder containing package.json:
$ cd path-to-your-downloaded-project
$ npm ci
$ npm install --save-dev tsxThe final command records tsx, the tool that runs TypeScript files, which the extracted "start": "tsx server.ts" script expects.
You can start the stdio server directly:
$ npm startIt waits for an MCP client instead of printing a browser URL. Stop it with Ctrl+C before starting Inspector.
npm ci, add the missing tsx tool that runs TypeScript files, then try npm start. When the terminal goes quiet, nothing is wrong: the server is waiting for a client to talk to it. I restarted mine three times before anyone told me that! Test it with MCP Inspector
From the same project folder, run the official MCP Inspector:
$ npx @modelcontextprotocol/inspector npx tsx server.tsThe first npx downloads and starts Inspector, and it may ask permission for that one-time install; confirm that the package is @modelcontextprotocol/inspector before accepting, and for repeatable team use, pin a reviewed version instead of relying indefinitely on the newest release. Inspector then launches your server with npx tsx server.ts as its stdio child process. Its web UI runs on its own local port, separate from the stdio connection to the server. Open the local URL printed in the terminal if it does not open automatically.
In Inspector, connect to the server, list its tools and resources, and call the weather tool with one of the inputs used in the course. The tool use chapter explains what a tool definition like this gives a model. Leave the terminal open while testing, then stop Inspector and the child server with Ctrl+C.
Connect another MCP client
A desktop client needs an executable command and arguments for launching the same stdio server. First, copy the absolute paths to the extracted project folder and its server.ts file. Configure the client with this process contract, replacing both example paths:
command: npm
arguments:
- --prefix
- /absolute/path/to/project
- exec
- --
- tsx
- /absolute/path/to/project/server.tsThe --prefix value makes npm use the tsx dependency installed in that project even when the desktop client starts from another working directory. A client configured to run tsx on its own, with no npm --prefix in front of it, depends instead on a global install and on the client's PATH, which often differs from your terminal's. Keep each argument as a separate item so paths containing spaces remain one value. Do not add a URL or port: this server communicates over stdio.
Connecting servers like this one is how desktop clients give their models tools; the agents chapter covers the loop that uses those tools.
Client configuration formats differ, so map that command and those arguments to the fields in the client's current MCP setup instructions. Restart the client after changing its configuration. You do not need another project download: connect it to the extracted server you already tested.
npm, add the documented arguments with both absolute paths filled in, then restart the client. You are reusing the same extracted server Inspector tested, so if it worked there, the server side is already proven. Troubleshooting
tsx: command not found: Run npm install --save-dev tsx in the project folder. For a desktop client, also confirm that its command is npm and its arguments begin with --prefix followed by the absolute project path.
Inspector rejects the Node version: Install Node 24, verify with node --version, and reopen the terminal.
npm start appears to hang: That is expected for a stdio server waiting for a client. Use Inspector to interact with it.
Inspector shows no tools: Check the terminal for TypeScript or connection errors and confirm the final command ends with npx tsx server.ts.
tsx if it is missing, move to Node 24 if Inspector refuses to start, and remember that a quiet server is a waiting server, not a broken one. Nearly every problem on this page is one of those three. 
