
Store and retrieve entities, relations and observations in a persistent local knowledge graph.

A TypeScript demonstration MCP server that hosts a session-based number guessing game with per-user dynamic tools and resources.
Number Guessing Game MCP Server is cataloged as an MCP server attributed to portal-labs-infrastructure. A TypeScript demonstration MCP server that hosts a session-based number guessing game with per-user dynamic tools and resources. It is categorized under ai agents-models. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Number Guessing Game MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
Yes, each connecting user gets an isolated game state and set of MCP entities, with tools enabled or disabled per user.
Game state and high scores are persisted in Firestore, which decouples the server's runtime from the game state.
The server exposes start_game, guess_number, and give_up tools that change availability with game state.
README.md · 07de26169c05 · Fetched 2026-11-13 10:47:57 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
A demonstration Model Context Protocol (MCP) server implemented in TypeScript. It showcases a dynamic, session-based architecture where each user gets their own set of tools and resources, managed by a central controller. This server hosts a simple number guessing game.
Access it at: https://mcp.number-guessing-game.portal.one/mcp
Find more remote servers at: https://remote-mcp-servers.com/
Read our article talking about the benefits of dynamic MCP servers:
https://portal.one/blog/dynamic-mcp-servers-tame-complexity/
Here's an example of interacting with the server manually. Notice the tools change depending on the current game state.
https://github.com/user-attachments/assets/8bb15870-2adc-4412-a072-4fc4eb14bbef
And a video of an agent interacting with the server. You can't see in the video, but the tools available to the agent are changing as well based on the game state.
https://github.com/user-attachments/assets/d7d338a2-8a93-46c3-b4a9-1a6b4caf9dc0
This project is intended as a learning resource and a practical example for building dynamic, multi-user MCP applications.
start_game, guess_number, give_up) are enabled or disabled on a per-user basis, reflecting their individual game state.game_state resource is created and destroyed per-user as they start and end games.McpServer handles all connections.The server follows a modern, scalable pattern where a central controller manages ephemeral, session-specific resources.
Global Server Config (src/mcp_setup/index.ts): A McpServer instance is created when the application starts. It acts as a "blank slate" connection manager and does not contain any tools or resources itself.
HTTP Controller (src/controllers/mcp.controller.ts): This is the brain of the application.
/mcp endpoint.StreamableHTTPServerTransport.onsessioninitialized and onclose) to manage the user's session.Session Initialization (onsessioninitialized): When a user's transport is ready, the controller:
src/mcp_setup/tools and src/mcp_setup/resources.GameContext instance, linking it to the user's session ID and their unique MCP entities.GameSessionService) and uses the State Pattern (LobbyState or PlayingState) to enable/disable the correct tools for their session.Session Destruction (onclose): When a user disconnects, the controller:
This architecture ensures that each user's UI state (e.g., which tools are enabled) is completely isolated, stateful, and managed dynamically, while the server itself remains scalable.
git clone https://github.com/portal-labs-infrastructure/number-guessing-game-mcp-server
cd number-guessing-game-mcp-server
npm install
# or
yarn install
gcloud auth application-default login
.env file: Copy the example file.
cp .env.example .env
.env: Fill in the required environment variables.
PORT: The port for the server to run on (e.g., 8083).GCP_PROJECT_ID: Your Google Cloud Project ID.BASE_URL: The public-facing URL of your server (e.g., http://localhost:8083).OAUTH_ISSUER_URL: The base URL of your OAuth provider.DOCS_URL: A link to your service's documentation.npm run dev
Compile TypeScript:
npm run build
Start the server:
npm start
You should see output indicating the server is running and connected to Firestore.
You'll need an MCP client that supports the following capabilities:
You can use the MCP Inspector, but it does not have Tool and Resource notifications so you have to manually refresh the tools and resources.
You use the the Portal One web client and find the server in the list of available MCP servers and click 'connect'.
See other clients that support dynamic MCP tools and resources (discovery) in the MCP SDK Example Clients.
Make sure the server can be accessed by the client. If you're running the server locally, and using a web based client, you can use a tool like ngrok to expose the server to the internet:
ngrok http http://localhost:8083
If you're using a client on localhost, you can connect directly to http://localhost:8083/mcp.
src/
├── config/
│ └── index.ts # Loads and exports environment variables
├── controllers/
│ └── mcp.controller.ts # Manages session lifecycles and creates entities on-demand
├── game/
│ ├── commands/ # Command Pattern: Encapsulates user actions
│ │ ├── command.interface.ts
│ │ ├── give-up.command.ts
│ │ ├── guess-number.command.ts
│ │ └── start-game.command.ts
│ ├── core/
│ │ ├── game-context.ts # Central game logic coordinator for a SINGLE session
│ │ ├── game-session-service.ts # Handles all Firestore interactions (get/set state)
│ │ ├── game-types.ts # Core TypeScript interfaces for the game
│ │ ├── resource-factory.ts # (Not used in current setup, but available)
│ │ └── tool-factory.ts # (Not used in current setup, but available)
│ ├── states/ # State Pattern: Manages game flow (Lobby, Playing)
│ │ ├── game-state.interface.ts
│ │ ├── lobby.state.ts
│ │ └── playing.state.ts
│ └── utils/
│ └── game-constants.ts # Shared game constants
├── index.ts # Main application entry point (Express server setup)
├── mcp_setup/
│ ├── index.ts # Creates the single, global McpServer instance
│ ├── resources/ # Factory functions for creating MCP resources
│ │ ├── index.ts # Barrel file for exporting all resource setups
│ │ └── ... (setup-banner-image-resource.ts, etc.)
│ └── tools/ # Factory functions for creating MCP tools
│ ├── index.ts # Barrel file for exporting all tool setups
│ └── ... (setup-guess-number-tool.ts, etc.)
├── routes/
│ └── mcp.routes.ts # Defines the Express routes for /mcp
└── services/
└── firestore.service.ts # Initializes the global Firestore client
onsessioninitialized, onclose) to manage the setup and teardown of session resources.Contributions are welcome! If you have ideas for improvements, new features, or find any bugs, please feel free to open an issue or a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Number Guessing Game MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/number-guessing-game-mcp-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

Store and retrieve entities, relations and observations in a persistent local knowledge graph.

Organize problem solving into revisable, branching thought steps through an MCP tool.

Query-aware context compression with an MCP plugin for coding agents, plus Python and HTTP interfaces for reducing the context sent to a language model.