Content
# EasyChatDM - Demonstrates creating a simple MCP Server tools
Example MCP Server tools for playing D&D with generative AIs. These tools are oracles that are used to determine random yes/no questions but also descriptions, events, NPCs, etc. They are "random tables" to use when you want to introduce some uncertainty, twists and turns, and randomness to your gaming. This project is for educational purposes, so little attention is given to good code design.
These tools are MCP Server tools that will work with Claude desktop and other MCP Clients. They're written in Spring AI MCP. This project is for education, so no consideration is given to good design. Instead, the code is written to make it easy to follow step-by-step how to create tools.
# Running it
You should copy over the contents of contents of <code>src/main/easychatdmdir/prompts/</code> to <code>~/.easychatdm</code>. These are files for prompts, oracles, etc. uses.
## Database configuration
The DM Journal now persists to a database instead of plain JSON files. Local runs default to SQLite with the database file stored under `~/.easychatdm/easychatdm.db`. Switching between SQLite and PostgreSQL is controlled entirely through system properties or environment variables.
### Available properties
| Property | Default | Description |
| --- | --- | --- |
| `easychatdm.dir` | `${user.home}/.easychatdm` | Base directory for prompts/oracles and, for SQLite, the database file location. |
| `easychatdm.db.type` | `sqlite` | Selects `sqlite` (local file) or `postgres` (remote database). |
| `easychatdm.db.sqlite.path` | *(derived from `easychatdm.dir`)* | Overrides the full path to the SQLite database. If set to a directory, the file name below is appended. |
| `easychatdm.db.sqlite.file-name` | `easychatdm.db` | Name used when creating the SQLite database under the resolved directory. |
| `easychatdm.db.sqlite.pool-size` | `1` | HikariCP pool size when using SQLite (typically keep at 1). |
| `easychatdm.db.postgres.url` | *(required when `db.type=postgres`)* | JDBC URL for the PostgreSQL instance. |
| `easychatdm.db.postgres.username` | *(required when `db.type=postgres`)* | Database username. |
| `easychatdm.db.postgres.password` | *(empty string)* | Database password. |
| `easychatdm.db.postgres.pool-size` | `4` | HikariCP pool size when using PostgreSQL. |
| `easychatdm.journal.export-files` | `true` for SQLite, `false` for Postgres | Mirrors journal contents to JSON/Markdown files when enabled. |
For Cloud Foundry (or any remote deployment) set the system properties with `JAVA_OPTS`, for example:
```
JAVA_OPTS: >-
-Deasychatdm.db.type=postgres
-Deasychatdm.db.postgres.url=${JDBC_DATABASE_URL}
-Deasychatdm.db.postgres.username=${JDBC_DATABASE_USERNAME}
-Deasychatdm.db.postgres.password=${JDBC_DATABASE_PASSWORD}
```
# Acknowledgements
- Some oracle values and schemes used from [JeansenVaars's Play By Writing](https://github.com/saif-ellafi/play-by-the-writing), and PUM, GUM, etc. systems.
# More
See [the ChatDM project](https://github.com/cote/chatdm/tree/main) for a more complex, feature-ful somewhat better designed version of this EasyChatDM.
Here are [some videos](https://www.youtube.com/playlist?list=PLk_5VqpWEtiWA4NtTC_QwTofEpd34fRFx) going over the project:
1. [Part one of a video series](https://www.youtube.com/watch?v=iROihhd_OiI)
where I build a very simple MCP too-land.
2. In [part two of the video series](https://www.youtube.com/watch?v=VD1GFZgtzuI) where I build a file-based oracle and go over how to use the logs Claude makes and start doing your own logging.
3. In [part three, I build an MCP Resource](https://www.youtube.com/watch?v=b_vKjph8W2o) to serve as a DM Journal to persist game information between play sessions.
4. Finally, [I get around to making an MCP Prompt](https://www.youtube.com/watch?v=xEtYBznneFg), which is really exciting.
This is the first glimpse at something that feels "agentic."
Keep an eye on [the playlist](https://www.youtube.com/playlist?list=PLk_5VqpWEtiWA4NtTC_QwTofEpd34fRFx) for the rest of the videos as they come out.
# References
- [Enabling developer mode in Claude desktop](https://modelcontextprotocol.io/quickstart/user)
- [The ChatDM project](https://github.com/cote/chatdm/tree/main) - more sophisticated ChatDM tool that's better designed, has more tools, etc.
- [Dan Vega's MCP examples](https://github.com/danvega/dv-courses-mcp).
- [Plot Unfolding Machine](https://jeansenvaars.itch.io/plot-unfolding-machine) - some prompts are based on JeansenVaar's PUM system, which is CC BY-NC-SA 4.0.
- [My experience playing D&D with ChatGPT and generative AI](https://www.youtube.com/playlist?list=PLk_5VqpWEtiWbS-AHbk6WxgMfnpYaIx3g) - video notebook of how I play D&D with the AIs.
# Versions
- 0.0.4 - DM Journal stored in SQLite by default, switchable to PostgreSQL via system properties.
- 0.0.3 - relativly stable, before converting over to use services for DM journal storage. This version still depends on file access.
Connection Info
You Might Also Like
markitdown
Python tool for converting files and office documents to Markdown.
Fetch
Retrieve and process content from web pages by converting HTML into markdown format.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
atomic-red-team-mcp
MCP server for accessing Atomic Red Team tests and tools.
Claude-Code-Zen-mcp-Skill-Work
A ready-to-use rule system and skill package for AI programming agents.
btp-sap-odata-to-mcp-server
Transform SAP systems into conversational AI interfaces using OData services.