Skip to content

feat: initial PCM MCP server - #1

Merged
mpicciolli merged 30 commits into
mainfrom
feature/init-pcm-mcp-server
Jun 25, 2026
Merged

feat: initial PCM MCP server#1
mpicciolli merged 30 commits into
mainfrom
feature/init-pcm-mcp-server

Conversation

@mpicciolli

@mpicciolli mpicciolli commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Overview

Initial implementation of the PCM MCP server — a Model Context Protocol server that exposes Pro Cycling Manager save files (.cdb) to MCP clients for inspection and querying.

What's included

  • MCP server setup (src/index.ts) with stdio transport and tool registration
  • Save file management (src/saves.ts, src/save-db.ts) — discover saves, select an active save, and manage DB connections via withSaveDb for consistent open/close handling
  • Tools (src/tools/):
    • list_saves — list available PCM save files
    • select_save — set the active save
    • get_save_schema — retrieve save file metadata
    • get_table_schema — inspect .cdb table structure
    • query_save — run read-only SQL queries against a save
    • get_player_info — retrieve active player and team details
  • Tooling: TypeScript config, tsup bundling, vitest test setup, and a GitHub Actions CI workflow
  • Docs: README.md with description, tools, installation, and usage; AGENTS.md

@mpicciolli
mpicciolli force-pushed the feature/init-pcm-mcp-server branch from 4c97e73 to 56229ee Compare June 24, 2026 12:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Initial scaffold of a PCM MCP server that exposes Pro Cycling Manager .cdb saves via MCP tools, plus the build/test/lint/CI plumbing and contributor docs to support development.

Changes:

  • Added MCP server entrypoint and a suite of tools for save discovery, validation, metadata, and read-only querying.
  • Implemented save discovery/validation and a withSaveDb helper to open .cdb files as an in-memory sql.js database.
  • Added TypeScript/tsup/vitest/Biome configuration, CI workflow, and updated documentation.

Reviewed changes

Copilot reviewed 18 out of 21 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/index.ts MCP server entrypoint using stdio transport; registers all tools.
src/helpers.ts Standardized MCP tool success/error response helpers.
src/saves.ts Windows-only save discovery + .cdb validation utilities.
src/save-db.ts withSaveDb helper to load .cdb into in-memory sql.js and ensure closure.
src/tools/index.ts Central registration for all tools.
src/tools/list-saves.ts list_saves tool (Windows auto-discovery).
src/tools/select-save.ts select_save tool (validate + return metadata).
src/tools/get-save-info.ts get_save_info tool (table listing from DB_STRUCTURE).
src/tools/get-table-info.ts get_table_info tool (table schema + row count).
src/tools/get-player-info.ts get_player_info tool (active player + team join).
src/tools/query-save.ts query_save tool (read-only query enforcement + row limiting).
package.json Project packaging + scripts + dependencies.
tsconfig.json TypeScript strict config for the project.
tsup.config.ts Bundling configuration for the CLI/server.
vitest.config.ts Vitest configuration including coverage settings.
biome.json Biome formatting/lint configuration.
.github/workflows/ci.yml CI workflow for lint/build/test on PRs and main.
README.md End-user documentation for tools, installation, and usage.
AGENTS.md Contributor/agent guidance for repository conventions and architecture.
.gitignore Ignore rules for dependencies/build/test artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json
Comment thread vitest.config.ts
Comment thread src/tools/get-save-schema.ts
Comment thread src/tools/query-save.ts Outdated
Comment thread README.md Outdated
Comment thread AGENTS.md Outdated
Comment thread src/tools/query-save.ts Outdated
Comment thread src/tools/get-table-schema.ts Outdated
Comment thread README.md Outdated
Comment thread package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 24 changed files in this pull request and generated 7 comments.

Comment thread src/tools/query-save.ts Outdated
Comment thread src/tools/get-table-schema.ts Outdated
Comment thread src/tools/select-save.ts
Comment thread src/tools/select-save.ts
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
Comment thread src/tools/index.ts
mpicciolli and others added 2 commits June 25, 2026 18:01
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 21 out of 24 changed files in this pull request and generated 7 comments.

Comment thread src/tools/select-save.ts
Comment thread src/tools/list-saves.ts
Comment thread src/save-db.ts
Comment thread src/save-db.ts
Comment thread src/tools/get-player-info.ts Outdated
Comment thread src/tools/query-save.ts Outdated
Comment thread src/tools/select-save.ts Outdated
@mpicciolli
mpicciolli merged commit 856b2aa into main Jun 25, 2026
2 checks passed
@mpicciolli
mpicciolli deleted the feature/init-pcm-mcp-server branch June 27, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants