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 requires Node 22.19 or newer, so Node 24 clears 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 it runs with comes from whatever launches it on your machine: your terminal, Inspector, or a desktop client.
.env file. Expect one surprise: this server never opens a web page. It waits quietly for a client to talk to it.
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. Stop it with Ctrl+C before you open Inspector.
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. Inspector then launches your server with npx tsx server.ts as its stdio child process. Inspector's 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.
Approve the one-time package download deliberately
npx may ask permission to install MCP Inspector. Confirm that the package is @modelcontextprotocol/inspector before accepting. For repeatable team use, pin a reviewed version instead of relying indefinitely on the newest release.
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.
If npx asks to install a package, check that the name is @modelcontextprotocol/inspector before you accept.
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, without 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.
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. The agents chapter covers the loop a client runs when its model uses tools like this one.
npm, add the arguments above with both absolute paths filled in, then restart the client. You are reusing the server Inspector already tested, so if it worked there, the server side is fine and any problem is in the client's settings.
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 waiting, not broken. Most problems on this page are one of those three.

