beijing-fushengji-mcp

beijing-fushengji-mcp

Enables AI agents to play a classic turn-based business game set in Beijing, autonomously making decisions like moving, trading, banking, and debt repayment over 40 days. Supports loading and saving game records for cross-session learning.

Category
Visit Server

README

北京浮生记 MCP Server

经典回合制经商游戏「北京浮生记」的 MCP Server 实现。AI Agent 通过 MCP 工具自主完成整局 40 天的游戏——移动、买卖、存取款、还债,全程无需人类干预。

北京浮生记

OpenClaw 的游戏

这是一款让 OpenClaw 自己玩的游戏。

OpenClaw 已经有了自己的社交平台 Moltbook,能在上面发帖、互动、交朋友。那 OpenClaw 当然也可以有自己的游戏——不是帮人类玩,是 AI 自己玩给你看。

你只需要说一句「来一局北京浮生记」,OpenClaw 就会化身北漂青年铁牛,独立完成 40 天的买卖、还债、存钱、跑路……全程自主决策,你只需要坐下来当观众。每隔 10 天铁牛还会给你"发朋友圈"汇报战况,游戏结束后还有一篇精彩的北漂故事回顾。

人类玩游戏,AI 看着。现在反过来了——AI 玩游戏,你看着。

游戏简介

你扮演北漂青年铁牛,带着 2000 元现金和 5000 元债务来到北京。在 40 天内通过倒卖 8 种商品(进口香烟、走私汽车、盗版 VCD 等)赚钱还债。债务每天涨 10% 复利,不还会膨胀到 22 万+。

最终得分 = 现金 + 银行存款 - 债务

提供的 MCP 工具

工具 说明
start_game 开始新一局游戏
move 移动到指定地点(消耗 1 天)
buy / sell 买入 / 卖出商品
bank 银行存款或取款
repay_debt 向村长还债
hospital 去医院治疗
rent_house 租更大的房子(扩容背包)
get_status 查看当前游戏状态
load_game_records 加载历史游戏记录和经验总结
save_game_records 保存游戏记录和经验总结

安装

前置条件

  • Node.js >= 18
  • npm

步骤

# 1. 克隆仓库
git clone <repo-url> beijing-fushengji-mcp
cd beijing-fushengji-mcp

# 2. 安装依赖
npm install

# 3. 编译 TypeScript
npm run build

编译后入口文件为 dist/index.js,通过 stdio 提供 MCP 服务。

在 OpenClaw 中安装

手动安装

完成上面的编译步骤后,执行以下三步将 Skill 注册到 OpenClaw:

# 1. 创建符号链接,让 OpenClaw 发现这个 Skill
ln -s "$(pwd)" ~/.openclaw/skills/beijing-fushengji-mcp

# 2. 注册 MCP Server 到 mcporter 配置
#    编辑 ~/.openclaw/workspace/config/mcporter.json,在 mcpServers 中添加:
#    "beijing-fushengji": {
#      "command": "node <绝对路径>/beijing-fushengji-mcp/dist/index.js"
#    }

# 3. 重启 Gateway 生效
openclaw gateway restart

验证安装

# 检查 Skill 是否就绪
openclaw skills list | grep beijing
# 应显示: ✓ ready │ 📦 beijing-fushengji

Agent 自动安装指引

如果你是 AI Agent 并需要自动完成安装,按以下步骤执行:

  1. 将本项目克隆到 ~/.openclaw/workspace/beijing-fushengji-mcp
  2. 在项目目录执行 npm install && npm run build
  3. 创建符号链接:ln -s ~/.openclaw/workspace/beijing-fushengji-mcp ~/.openclaw/skills/beijing-fushengji-mcp
  4. 读取 ~/.openclaw/workspace/config/mcporter.json,在 mcpServers 对象中追加:
    "beijing-fushengji": {
      "command": "node ~/.openclaw/workspace/beijing-fushengji-mcp/dist/index.js"
    }
    
    注意:command 中的路径必须展开为绝对路径(替换 ~)
  5. 执行 openclaw gateway restart 重启 Gateway
  6. 执行 openclaw skills list | grep beijing 确认状态为 ✓ ready

在其他 MCP 客户端中使用

在任何支持 MCP 的客户端(Claude Desktop、Cursor 等)的配置中添加:

{
  "mcpServers": {
    "beijing-fushengji": {
      "command": "node",
      "args": ["<绝对路径>/beijing-fushengji-mcp/dist/index.js"]
    }
  }
}

项目结构

src/
├── types.ts        # 类型定义(GameState, GameResponse 等)
├── game-data.ts    # 游戏数据(商品、事件、地点、常量)
├── game-engine.ts  # 游戏引擎(状态管理、回合推进、事件触发)
└── index.ts        # MCP Server 入口(注册 13 个工具)
records/
└── game_records.md # AI Agent 游戏记录与经验档案(跨局持久化,≤2000字符)

技术栈

  • TypeScript 5.8(ES2022 / Node16 ESM)
  • @modelcontextprotocol/sdk — MCP 协议
  • zod — 参数校验
  • 游戏状态纯内存,游戏记录持久化到 records/game_records.md

原版游戏

https://github.com/chrisguo/beijing_fushengji

许可证

GPL 2.0

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured