Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graftcode By Examples

Collection of hands-on examples built, tested, and run against GraftCode — capturing the best practices I've learned for using the platform.

The goal of this repo is to serve as a practical reference for:

  • Exposing existing services (Python, Node.js, etc.) as MCP servers via the GraftCode Gateway.
  • Integrating those services with AI assistants like Claude Desktop.
  • Comparing local-vs-containerized approaches and documenting trade-offs.
  • Sharing repeatable, copy-pasteable patterns for common GraftCode workflows.

Learn more about GraftCode

Examples in this repo

Folder Description
py-ai-backend/ Python energy-price calculator exposed as an MCP server, both as a local FastMCP script and via Docker + the GraftCode Gateway. Follows the Expose MCP (Python) quick-start.
dotnet-react-frontend/ Frontend → Backend. A React app calls a .NET TripBudget method as a typed npm package (a "Graft") — cross-language, no REST client, no DTOs, no OpenAPI. Includes a seed/ folder for the with-vs-without rules test.
js-mcp-backend/ AI (MCP) → Backend. A plain JS TripBudget module is auto-exposed as MCP tools; Claude discovers and calls the real methods — no MCP server code, no schemas. Includes a seed/ folder for the with-vs-without rules test.

More examples will be added over time as I explore additional GraftCode features and integration patterns.

AI-assistant rules (optional)

The dotnet-react-frontend/ and js-mcp-backend/ examples work best when your AI assistant defaults to GraftCode instead of generating REST boilerplate. GraftCode publishes rules that do exactly that — a CLAUDE.md router plus per-language .claude/rules/ files read on demand.

This repo intentionally does not vendor those rules (they evolve upstream and belong in your project, not this reference repo). To use them, copy the Claude-native files into your own project's root from GraftCode's official repo:

# in your own project (not this repo)
git clone --depth 1 https://github.com/grft-dev/graftcode-demos /tmp/graftcode-demos
cp    /tmp/graftcode-demos/rules/Claude/CLAUDE.md   ./          # always-on router
cp -R /tmp/graftcode-demos/rules/Claude/.claude     ./          # per-language rules read on demand

Rules source: grft-dev/graftcode-demos → rules/Claude (rules for other assistants — Cursor, Copilot, Cline, etc. — live alongside it under rules/).

Want to see what difference the rules actually make? Each example ships a seed/ folder — the same backend with neutral comments — so you can ask an identical prompt with and without them and compare the result. See dotnet-react-frontend/seed/ or js-mcp-backend/seed/.

How to use this repo

  1. Pick an example folder that matches what you want to try.
  2. Read its local README.md — each example is self-contained with its own setup, run, and integration steps.
  3. Follow along with the linked GraftCode Academy guide for the full context.

Contributing / feedback

This is primarily a personal learning repo, but suggestions and corrections are welcome via issues or pull requests.

About

A personal collection of hands-on examples built, tested, and run against GraftCode!

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages