About Guide
Guide is an MCP server published by ruixingshi in the Developer Tools category: a repository containing the basic MCP client and MCP server (based on SDK and JSON-RPC implementation) to help everyone learn MCP from 0.
The repository has 1 stars and 0 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/ruixingshi/mcp-guideThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Guide
Powered by Claude · Grounded in docs
Security checks
Static checks derived from the repository 3 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository ships documentation.
- !License declaredNo license file. Legally you have no right to use it in a product.
- !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
- ✓Dependencies pinnedA lockfile pins dependency versions.
- ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
MCP Guide
A repository containing the basic MCP client and MCP server (based on SDK and JSON-RPC implementation) to help everyone learn MCP from 0.
Project Structure
mcp-client.ts: A command-line interface (CLI) client that connects to MCP servers and uses OpenAI's API to process user queries and interact with the available tools.mcp-server-v1.ts: An MCP server implementation using the@modelcontextprotocol/sdklibrary. It provides weather tools (get-alertsandget-forecast) over stdio.mcp-server-v2.ts: Another MCP server implementation, similar tov1, but using a slightly different server setup from the SDK. It also provides weather tools over stdio.mcp-server-protocol.ts: An MCP server implemented as an HTTP server using Express.js. It manually implements the JSON-RPC based MCP, providing the same weather tools over an HTTP endpoint.utils.ts: Contains utility functions for interacting with the NWS API, including making requests and formatting alert data.types.ts: Defines TypeScript types and Zod schemas for validating arguments and structuring data related to the NWS API.
Features
- Multiple Server Implementations:
- Stdio-based MCP server (v1 and v2 using the SDK).
- HTTP-based MCP server (manual protocol implementation).
- Weather Tools:
get-alerts: Fetches weather alerts for a given US state.get-forecast: Retrieves the weather forecast for a specific latitude and longitude.
- OpenAI Integration: The client uses an OpenAI model to understand natural language queries and decide which tool to call.
- Dynamic Server Connection: The client can connect to multiple configured MCP servers.
Setup
- Install Dependencies:
npm install - Environment Variables:
Create a
.envfile in the root of the project and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here # Optional: Specify a different OpenAI model or base URL # OPENAI_MODEL=gpt-3.5-turbo # OPENAI_BASE_URL=https://api.openai.com/v1
Running the Servers
You can run the different server implementations using the following commands:
- MCP Server V1 (stdio):
tsx mcp-server-v1.ts - MCP Server V2 (stdio):
tsx mcp-server-v2.ts - MCP Server (HTTP):
This server will typically run ontsx mcp-server-protocol.tshttp://localhost:3000.
Running the Client
The client is configured in mcp-client.ts. By default, it attempts to connect to servers marked with isOpen: true in its configuration.
To run the client:
tsx mcp-client.ts
Once connected, you can type your weather-related queries, for example:
- "What are the weather alerts for CA?"
- "Get the forecast for latitude 34.05 and longitude -118.24"
The client will interact with the connected MCP server(s) and OpenAI to provide the requested information. Type quit to exit the client.
How it Works
- The
mcp-client.tsstarts and connects to the configured MCP servers. - It lists the available tools from each connected server.
- When the user enters a query, the client sends this query along with the list of available tools to an OpenAI model.
- The OpenAI model determines if any tool can fulfill the request.
- If a tool is chosen, the client calls the respective tool on the appropriate MCP server with the arguments identified by the OpenAI model.
- The MCP server executes the tool (e.g., by calling the NWS API) and returns the result.
- The client receives the tool's result and sends it back to the OpenAI model along with the original query and conversation history.
- The OpenAI model generates a final response for the user based on the tool's output.
- The client displays this response.
Notes
- The NWS API primarily provides data for locations within the United States.
- The
mcp-server-v1.tsandmcp-server-v2.tsuse the@modelcontextprotocol/sdkfor easier MCP implementation over stdio. - The
mcp-server-protocol.tsdemonstrates a manual implementation of the MCP over HTTP, which involves handling JSON-RPC messages directly. - Error handling is implemented in both client and server components.
- The client can be extended to support more servers or different types of transport (e.g., SSE).
README fetched from the repository 3 days ago. The original is authoritative.