### Get Modding Code Example Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Retrieves working code examples for a given topic, specifying the desired language and mod loader. Useful for learning specific implementation patterns. ```typescript { topic: "custom block with block entity", language: "java", loader: "fabric" } ``` -------------------------------- ### Development Setup and Commands (Bash) Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Instructions for cloning the repository, installing dependencies, and running the project in development mode using npm. Also includes common build and utility commands for development and production. ```bash # Clone repository git clone https://github.com/OGMatrix/mcmodding-mcp.git cd mcmodding-mcp # Install dependencies npm install # Run in development mode npm run dev ``` ```bash # Development npm run dev # Watch mode with hot reload npm run typecheck # TypeScript type checking npm run lint # ESLint npm run test # Run tests npm run format # Prettier formatting # Production npm run build # Build TypeScript npm run build:prod # Build with fresh documentation index npm run index-docs # Index documentation with embeddings # Database Management npx mcmodding-mcp manage # Interactive database installer/updater ``` -------------------------------- ### Get Specific Mod Example Details Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Retrieves detailed information, including full code and explanations, for a specific modding example identified by its ID. Can optionally include related examples. ```typescript // Example: Get full details for an example { id: 42, include_related: true } ``` -------------------------------- ### Documentation Tools API Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Provides tools for searching documentation, getting code examples, explaining concepts, and retrieving Minecraft version information. ```APIDOC ## Documentation Tools API ### Description Provides tools for searching documentation, getting code examples, explaining concepts, and retrieving Minecraft version information. ### Endpoints #### `search_fabric_docs` ##### Description Search documentation with smart filtering. ##### Method POST ##### Endpoint /search_fabric_docs ##### Parameters ###### Request Body - **query** (string) - Required - The search query. - **category** (string) - Optional - Filter by category (e.g., 'items'). - **loader** (string) - Optional - Filter by loader ('fabric' | 'neoforge'). - **minecraft_version** (string) - Optional - Filter by Minecraft version. ##### Request Example ```json { "query": "how to register custom items", "category": "items", "loader": "fabric", "minecraft_version": "1.21.10" } ``` #### `get_example` ##### Description Get working code examples for any topic. ##### Method POST ##### Endpoint /get_example ##### Parameters ###### Request Body - **topic** (string) - Required - The topic for which to get an example. - **language** (string) - Optional - The programming language (default: 'java'). - **loader** (string) - Optional - The mod loader ('fabric' | 'neoforge'). ##### Request Example ```json { "topic": "custom block with block entity", "language": "java", "loader": "fabric" } ``` #### `explain_fabric_concept` ##### Description Get detailed explanations of modding concepts with related resources. ##### Method POST ##### Endpoint /explain_fabric_concept ##### Parameters ###### Request Body - **concept** (string) - Required - The modding concept to explain. ##### Request Example ```json { "concept": "mixins" } ``` #### `get_minecraft_version` ##### Description Get current Minecraft version information. ##### Method POST ##### Endpoint /get_minecraft_version ##### Parameters ###### Request Body - **type** (string) - Required - The type of version information to retrieve ('latest' | 'all'). ##### Request Example ```json { "type": "latest" } ``` ```json { "type": "all" } ``` ``` -------------------------------- ### Mod Examples Tools API Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Tools for searching and retrieving code examples from a database of high-quality modding examples. ```APIDOC ## Mod Examples Tools API ### Description Tools for searching and retrieving code examples from a database of high-quality modding examples. ### Endpoints #### `search_mod_examples` ##### Description Search battle-tested code from popular mods. ##### Method POST ##### Endpoint /search_mod_examples ##### Parameters ###### Request Body - **query** (string) - Required - The search query. - **mod** (string) - Optional - Filter by mod name (e.g., 'Create'). - **category** (string) - Optional - Filter by example category (e.g., 'tile-entities'). - **complexity** (string) - Optional - Filter by complexity level (e.g., 'intermediate'). ##### Request Example ```json { "query": "block entity tick", "mod": "Create", "category": "tile-entities", "complexity": "intermediate" } ``` #### `get_mod_example` ##### Description Get detailed information about a specific example with full code and explanations. ##### Method POST ##### Endpoint /get_mod_example ##### Parameters ###### Request Body - **id** (integer) - Required - The unique identifier of the example. - **include_related** (boolean) - Optional - Whether to include related examples. ##### Request Example ```json { "id": 42, "include_related": true } ``` #### `list_canonical_mods` ##### Description Discover all indexed mods and their available examples. ##### Method GET ##### Endpoint /list_canonical_mods #### `list_mod_categories` ##### Description Browse available example categories (blocks, entities, rendering, etc.). ##### Method GET ##### Endpoint /list_mod_categories ``` -------------------------------- ### Run Interactive Database Manager (Bash) Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Launches the interactive command-line interface for managing MCModding-MCP documentation databases. Users can install, update, or re-download optional databases like Parchment mappings and mod examples. ```bash npx mcmodding-mcp manage ``` -------------------------------- ### Initialize project repository Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Commands to clone the repository, set up the upstream remote, and install project dependencies. ```bash git clone https://github.com/YOUR_USERNAME/mcmodding-mcp.git cd mcmodding-mcp git remote add upstream https://github.com/OGMatrix/mcmodding-mcp.git npm install ``` -------------------------------- ### Get Specific Mod Example by ID with MCP Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Retrieves detailed information for a specific mod example using its ID. The output includes the full code, explanation, best practices, common pitfalls, required imports, and related examples. This function requires the Mod Examples database and an example ID obtained from a search. ```typescript // MCP Tool Call: get_mod_example { id: 42, // Required: example ID from search results include_related: true // Optional: include related examples (default: true) } ``` -------------------------------- ### Search Mod Examples Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Searches through a database of code examples from popular mods. Allows filtering by query, mod, category, and complexity. ```typescript // Example: Find block entity implementations { query: "block entity tick", mod: "Create", // Optional: filter by mod category: "tile-entities", complexity: "intermediate" } ``` -------------------------------- ### POST /get_mod_example Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Retrieves the full details, code implementation, and best practices for a specific mod example by its unique ID. ```APIDOC ## POST /get_mod_example ### Description Get detailed information about a specific mod example by ID, including full source code and developer notes. ### Method POST ### Endpoint /get_mod_example ### Parameters #### Request Body - **id** (integer) - Required - Example ID from search results - **include_related** (boolean) - Optional - Include related examples (default: true) ### Request Example { "id": 42, "include_related": true } ### Response #### Success Response (200) - **title** (string) - Title of the example - **code** (string) - Full source code - **best_practices** (array) - List of recommended practices - **pitfalls** (array) - List of common issues to avoid #### Response Example { "title": "Kinetic Block Entity Ticking", "code": "public class KineticBlockEntity extends SmartBlockEntity { ... }", "best_practices": ["Always check isClientSide"] } ``` -------------------------------- ### POST /search_mod_examples Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Searches through canonical code examples based on specific criteria such as mod name, category, or complexity level. ```APIDOC ## POST /search_mod_examples ### Description Search through canonical code examples from popular open-source mods. Returns a list of matching implementations with metadata. ### Method POST ### Endpoint /search_mod_examples ### Parameters #### Request Body - **query** (string) - Optional - Search query string - **mod** (string) - Optional - Filter by mod name - **category** (string) - Optional - Filter by category (e.g., tile-entities, blocks) - **pattern_type** (string) - Optional - Filter by pattern type - **complexity** (string) - Optional - Filter by difficulty (beginner, intermediate, advanced, expert) - **min_quality** (float) - Optional - Minimum quality score 0.0-1.0 (default: 0.5) - **featured_only** (boolean) - Optional - Only return featured examples - **limit** (integer) - Optional - Max results 1-20 (default: 5) ### Request Example { "query": "block entity tick", "mod": "Create", "category": "tile-entities", "limit": 5 } ### Response #### Success Response (200) - **examples** (array) - List of matching code examples with IDs and metadata #### Response Example { "examples": [ { "id": 42, "mod": "Create", "quality": "92%", "title": "Kinetic Block Entity Ticking" } ] } ``` -------------------------------- ### Retrieve Minecraft Modding Code Examples Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Retrieves working code examples for Minecraft modding topics, providing complete snippets with context, explanations, and source references. Supports filtering by topic, language, loader, Minecraft version, and category. ```typescript // MCP Tool Call: get_example { topic: "custom block with block entity", // Required: topic or pattern to search language: "java", // Optional: "java", "json", "groovy" (default: "java") loader: "fabric", // Optional: "fabric" | "neoforge" | "shared" minecraft_version: "1.21.4", // Optional: target version or "latest" category: "blocks", // Optional: filter by category limit: 5 // Optional: max examples 1-10 (default: 5) } // Example Response: // ## Code Examples for "custom block with block entity" // // ### Example 1: Block Entity Registration // **Source:** Fabric Wiki - Block Entities // **Language:** java // **Loader:** fabric // // ```java // public class DemoBlockEntity extends BlockEntity { // public DemoBlockEntity(BlockPos pos, BlockState state) { // super(ModBlockEntities.DEMO_BLOCK_ENTITY, pos, state); // } // // @Override // public void writeNbt(NbtCompound nbt) { // super.writeNbt(nbt); // // Save data // } // // @Override // public void readNbt(NbtCompound nbt) { // super.readNbt(nbt); // // Load data // } // } // ``` ``` -------------------------------- ### Search Mod Examples with MCP Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Searches through canonical code examples from popular open-source mods. It allows filtering by query, mod name, category, pattern type, complexity, minimum quality, and featured status. The tool returns battle-tested implementations with AI-generated explanations and requires the optional Mod Examples database. ```typescript // MCP Tool Call: search_mod_examples { query: "block entity tick", // Optional: search query mod: "Create", // Optional: filter by mod name category: "tile-entities", // Optional: filter by category // Categories: "blocks", "items", "entities", "tile-entities", "rendering", // "gui", "networking", "worldgen", "data-generation", "recipes", // "events", "registry", "api-design", "cross-platform", etc. pattern_type: "event-handler", // Optional: filter by pattern type complexity: "intermediate", // Optional: "beginner" | "intermediate" | "advanced" | "expert" min_quality: 0.7, // Optional: minimum quality score 0.0-1.0 (default: 0.5) featured_only: false, // Optional: only featured examples limit: 5 // Optional: max results 1-20 (default: 5) } ``` -------------------------------- ### Install MCModding-MCP CLI Tool Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Installs the MCModding-MCP command-line interface globally via npm or allows direct execution with npx. This tool is used to manage and interact with the MCModding-MCP server. ```bash # Install globally via npm npm install -g mcmodding-mcp # Or run directly with npx npx mcmodding-mcp ``` -------------------------------- ### TypeScript Unit Testing with Vitest Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Shows how to write unit tests for TypeScript code using the Vitest testing framework. It covers setting up tests with `describe` and `it`, using `beforeEach` for setup, asserting expected outcomes with `expect`, and handling asynchronous operations within tests. ```typescript import { describe, it, expect, beforeEach, vi } from 'vitest'; import { myFunction } from './myModule.js'; describe('myFunction', () => { beforeEach(() => { // Setup before each test }); it('should return expected result for valid input', () => { const result = myFunction('valid input'); expect(result).toBe('expected output'); }); it('should handle edge cases', () => { expect(myFunction('')).toBe('default'); expect(myFunction(null as any)).toThrow(); }); it('should work with async operations', async () => { const result = await myAsyncFunction(); expect(result).toMatchObject({ status: 'success' }); }); }); ``` -------------------------------- ### List Canonical Mods with MCP Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Lists all indexed canonical mods available in the Mod Examples database. It can optionally include statistics about the database, such as the total number of mods, examples, relationships, and average quality score. This is useful for discovering which mods are indexed and available for examples. ```typescript // MCP Tool Call: list_canonical_mods { include_stats: true // Optional: include database statistics (default: false) } ``` -------------------------------- ### Commit Message Examples Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Examples of using Conventional Commits to maintain a clean and automated project history, including features, fixes, and breaking changes. ```bash # Feature git commit -m "feat(search): add fuzzy matching support" # Bug fix git commit -m "fix(indexer): handle malformed HTML gracefully" # Performance git commit -m "perf(embeddings): batch process in chunks of 500" # Breaking change git commit -m "feat(tools)!: rename search_docs to search_fabric_docs\n\nBREAKING CHANGE: Tool name changed for clarity" # Multi-line with body git commit -m "fix(chunker): prevent infinite loop on edge cases\n\nThe chunker could enter an infinite loop when overlap size\nexceeded the content length. Added bounds checking to ensure\nforward progress is always made." ``` -------------------------------- ### TypeScript JSDoc for Code Comments Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Demonstrates the use of JSDoc comments in TypeScript for documenting functions. It includes examples of documenting parameters, return values, potential errors, and providing usage examples with code blocks. Well-documented code enhances understanding and maintainability. ```typescript /** * Search the documentation index for relevant content. * * Uses a hybrid approach combining FTS5 full-text search * with semantic embeddings for best results. * * @param query - The search query string * @param options - Optional search filters * @returns Array of search results sorted by relevance * @throws {DatabaseError} If the database connection fails * * @example * ```typescript * const results = await searchDocs('mixin tutorial', { * category: 'getting-started', * limit: 10, * }); * ``` */ export async function searchDocs(query: string, options?: SearchOptions): Promise { // Implementation } ``` -------------------------------- ### Get Minecraft Version Information Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Retrieves information about Minecraft versions, either the latest available version or a list of all indexed versions. ```typescript // Get latest version { type: 'latest'; } ``` ```typescript // Get all indexed versions { type: 'all'; } ``` -------------------------------- ### Get Parchment Class Details Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Retrieves comprehensive information about a specific Minecraft class, including its methods and fields. Requires the class name. ```typescript // Example: Explore the Block class { class_name: "net.minecraft.world.level.block.Block", include_methods: true, include_fields: true } ``` -------------------------------- ### Get Parchment Method Signature Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Retrieves the full signature of a Minecraft method, including parameter names and types. Requires the class name and method name. ```typescript // Example: Get method details { class_name: "Block", method_name: "onPlace" } ``` -------------------------------- ### Get Method Signature Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Retrieve the complete signature for a specified Minecraft method, including parameter details and Javadoc. This is useful for understanding method usage and overriding. Requires the Parchment Mappings database. ```APIDOC ## POST /get_method_signature ### Description Get the full signature of a specific method including parameter names, types, and Javadoc. Useful for understanding how to call or override a Minecraft method. Requires the Parchment Mappings database. ### Method POST ### Endpoint /get_method_signature ### Parameters #### Request Body - **class_name** (string) - Required - The name of the class containing the method. - **method_name** (string) - Required - The name of the method. - **minecraft_version** (string) - Optional - The target Minecraft version (e.g., "1.21.4"). ### Request Example ```json { "class_name": "Block", "method_name": "onPlace", "minecraft_version": "1.21.4" } ``` ### Response #### Success Response (200) - **Descriptor** (string) - The method descriptor. - **Obfuscated** (string) - The obfuscated name of the method. - **Version** (string) - The Minecraft version. - **Parameters** (array) - An array of parameter objects, each containing an index, name, and description. - **Javadoc** (string) - The Javadoc for the method. #### Response Example ```json { "Descriptor": "(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Z)V", "Obfuscated": "m_6807_", "Version": "1.21.4", "Parameters": [ { "index": 0, "name": "state", "description": "The new block state being placed" }, { "index": 1, "name": "level", "description": "The level the block is being placed in" }, { "index": 2, "name": "pos", "description": "The position where the block is placed" }, { "index": 3, "name": "oldState", "description": "The previous block state at this position" }, { "index": 4, "name": "movedByPiston", "description": "Whether the block was moved by a piston" } ], "Javadoc": "Called when this block is placed in the world. Override this method to perform initialization logic when your block is placed." } ``` ``` -------------------------------- ### Get Detailed Class Information Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Retrieves comprehensive details for a specific Minecraft class, including methods, fields, and Javadoc documentation. Requires the Parchment Mappings database to be available. ```typescript // MCP Tool Call: get_class_details { class_name: "net.minecraft.world.level.block.Block", minecraft_version: "1.21.4", include_methods: true, include_fields: true } ``` -------------------------------- ### Programmatic Database Search (TypeScript) Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Shows how to use the SearchService class programmatically in TypeScript to search documentation with custom database paths. It includes searching for specific queries, retrieving database statistics, and closing the service. ```typescript // Programmatic usage - SearchService with custom database path import { SearchService } from 'mcmodding-mcp/services/search-service'; const searchService = new SearchService('/custom/path/to/mcmodding-docs.db'); const results = await searchService.search({ query: 'item registration', category: 'items', loader: 'fabric', minecraftVersion: '1.21.4', limit: 10 }); // Get database statistics const stats = searchService.getStats(); console.log(`Indexed: ${stats.totalDocuments} docs, ${stats.totalSections} sections`); console.log(`Versions: ${stats.versions.join(', ')}`); console.log(`Loaders: ${stats.loaders.join(', ')}`); searchService.close(); ``` -------------------------------- ### Explain Fabric Modding Concept Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Provides detailed explanations of modding concepts, including links to related resources. Helps in understanding complex topics like mixins. ```typescript { concept: 'mixins'; } ``` -------------------------------- ### Browse Package Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Explore the classes available within a specific Minecraft package. This endpoint is useful for discovering classes and understanding package structures. Requires the Parchment Mappings database. ```APIDOC ## POST /browse_package ### Description Browse classes in a specific Minecraft package. Useful for discovering available classes in a package. Requires the Parchment Mappings database. ### Method POST ### Endpoint /browse_package ### Parameters #### Request Body - **package_name** (string) - Required - The fully qualified name of the package to browse (e.g., "net.minecraft.world.level.block"). - **minecraft_version** (string) - Optional - The target Minecraft version (e.g., "1.21.4"). ### Request Example ```json { "package_name": "net.minecraft.world.level.block", "minecraft_version": "1.21.4" } ``` ### Response #### Success Response (200) - **Package** (string) - The name of the browsed package. - **Classes** (array) - An array of class objects, each containing the class name, number of methods, number of fields, and a brief description. #### Response Example ```json { "Package": "net.minecraft.world.level.block", "Classes": [ { "name": "Block", "methods": 156, "fields": 23, "description": "Base class for all blocks in Minecraft..." }, { "name": "Blocks", "methods": 2, "fields": 892, "description": "Registry of all vanilla block instances." }, { "name": "BlockBehaviour", "methods": 89, "fields": 12, "description": "Defines the behavior and properties of blocks..." }, { "name": "BlockState", "methods": 45, "fields": 8, "description": "Immutable snapshot of a block's state including properties..." } ] } ``` ``` -------------------------------- ### Search Fabric Documentation Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Searches the documentation database with optional filters for category, loader, and Minecraft version. Returns information relevant to the query. ```typescript { query: "how to register custom items", category: "items", // Optional filter loader: "fabric", // fabric | neoforge minecraft_version: "1.21.10" // Optional version filter } ``` -------------------------------- ### Project development and testing commands Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md A collection of npm scripts for development, testing, documentation indexing, and code validation. ```bash npm run dev npm run build npm run typecheck npm run lint npm run lint:fix npm run format npm run format:check npm test npm run test:watch npm run test:coverage npm run index-docs npm run index-docs:prod npm run validate ``` -------------------------------- ### Configure Environment Variables (Bash) Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Demonstrates setting environment variables to customize MCModding-MCP behavior. This includes specifying a custom database path, enabling debug logging, and setting a custom GitHub repository URL for updates. ```bash # Custom database path (disables auto-updates for that database) DB_PATH=/path/to/custom/mcmodding-docs.db mcmodding-mcp # Enable debug logging for troubleshooting MCP_DEBUG=true mcmodding-mcp # Custom GitHub repository for database updates GITHUB_REPO_URL=https://github.com/OGMatrix/mcmodding-mcp mcmodding-mcp ``` -------------------------------- ### Bash Commands for Running npm Tests Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Provides common bash commands for executing tests within an npm project. Includes commands for running all tests, enabling watch mode for continuous testing, and generating test coverage reports. ```bash # Run all tests npm test # Watch mode (re-runs on changes) npm run test:watch # With coverage report npm run test:coverage ``` -------------------------------- ### Search Fabric and NeoForge Modding Documentation Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Searches Fabric and NeoForge modding documentation using a multi-strategy approach including FTS5, semantic embeddings, and query expansion. It returns matched pages with snippets, sections, and metadata, supporting filtering by category, loader, and Minecraft version. ```typescript // MCP Tool Call: search_fabric_docs { query: "how to register custom items", // Required: search query category: "items", // Optional: filter by category // Categories: "getting-started", "items", "blocks", "entities", // "rendering", "networking", "data-generation", "all" loader: "fabric", // Optional: "fabric" | "neoforge" | "shared" minecraft_version: "1.21.4", // Optional: target MC version or "latest" include_code: true, // Optional: include code snippets (default: true) limit: 10 // Optional: max results 1-20 (default: 10) } // Example Response: // Found 5 relevant documentation pages for "how to register custom items": // // ## 1. Adding Items // **URL:** https://docs.fabricmc.net/1.21.4/develop/items/first-item // **Category:** items // **Loader:** fabric // **Minecraft Version:** 1.21.4 // **Relevance:** 95 (title match, exact version match) // // **Summary:** // This page covers how to register your first custom item in Fabric... // // **Key Sections:** // - **Registering the Item** (has code): Items are registered using Registry.register()... // - **Creating Item Settings**: Configure properties like stack size... ``` -------------------------------- ### TypeScript Error Handling with Try-Catch Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Demonstrates how to use try-catch blocks for handling asynchronous operations and returning structured error objects in TypeScript. This pattern helps in gracefully managing potential failures during API calls or other async tasks. ```typescript // Use try-catch for async operations try { const result = await fetchData(); return { success: true, data: result }; } catch (error) { console.error('[ModuleName] Error:', error); return { success: false, error: String(error) }; } // Return structured errors from tool handlers return { content: [{ type: 'text', text: `Error: ${message}` }], isError: true, }; ``` -------------------------------- ### Disabling Auto-Updates (Bash) Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Demonstrates how to disable the automatic database update feature by setting the `DB_PATH` environment variable to a custom location, forcing manual database management. ```bash DB_PATH=/path/to/my/database.db mcmodding-mcp ``` -------------------------------- ### Implement and register new MCP tools Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Instructions for creating a tool handler in TypeScript and registering it within the main application entry point. ```typescript // src/tools/myNewTool.ts import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js'; export interface MyToolParams { query: string; limit?: number; } export async function handleMyTool(params: MyToolParams): Promise { if (!params.query) { return { content: [{ type: 'text', text: 'Error: query is required' }], isError: true, }; } const result = await doSomething(params.query); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } ``` ```typescript // Registration in src/index.ts import { handleMyTool } from './tools/myNewTool.js'; { name: 'my_new_tool', description: 'Description of what this tool does', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query' }, limit: { type: 'number', description: 'Max results' }, }, required: ['query'], }, } case 'my_new_tool': return handleMyTool({ query: args?.query as string, limit: args?.limit as number, }); ``` -------------------------------- ### Browse Minecraft package classes Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Lists all classes contained within a specific Minecraft package. This is useful for discovery and navigating the Minecraft codebase structure. ```typescript { "package_name": "net.minecraft.world.level.block", "minecraft_version": "1.21.4" } ``` -------------------------------- ### Parchment Mappings Tools API Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Tools for searching and retrieving information from the Parchment Mappings database, including class details, method signatures, and obfuscated name lookups. ```APIDOC ## Parchment Mappings Tools API ### Description Tools for searching and retrieving information from the Parchment Mappings database, including class details, method signatures, and obfuscated name lookups. ### Endpoints #### `search_mappings` ##### Description Search Minecraft class, method, and field mappings with parameter names and Javadocs. ##### Method POST ##### Endpoint /search_mappings ##### Parameters ###### Request Body - **query** (string) - Required - The search query. - **type** (string) - Optional - The type of mapping to search for ('class' | 'method' | 'field' | 'all', default: 'all'). - **minecraft_version** (string) - Optional - The Minecraft version to search within. - **include_javadoc** (boolean) - Optional - Whether to include Javadoc in the results. ##### Request Example ```json { "query": "BlockEntity", "type": "class", "minecraft_version": "1.21.10", "include_javadoc": true } ``` #### `get_class_details` ##### Description Get comprehensive information about a Minecraft class including all methods and fields. ##### Method POST ##### Endpoint /get_class_details ##### Parameters ###### Request Body - **class_name** (string) - Required - The fully qualified name of the class. - **include_methods** (boolean) - Optional - Whether to include methods. - **include_fields** (boolean) - Optional - Whether to include fields. ##### Request Example ```json { "class_name": "net.minecraft.world.level.block.Block", "include_methods": true, "include_fields": true } ``` #### `lookup_obfuscated` ##### Description Look up deobfuscated names from obfuscated identifiers (useful for crash logs). ##### Method POST ##### Endpoint /lookup_obfuscated ##### Parameters ###### Request Body - **obfuscated_name** (string) - Required - The obfuscated identifier (e.g., method name). ##### Request Example ```json { "obfuscated_name": "m_46859_" } ``` #### `get_method_signature` ##### Description Get the full signature of a method including all parameter names and types. ##### Method POST ##### Endpoint /get_method_signature ##### Parameters ###### Request Body - **class_name** (string) - Required - The name of the class containing the method. - **method_name** (string) - Required - The name of the method. ##### Request Example ```json { "class_name": "Block", "method_name": "onPlace" } ``` #### `browse_package` ##### Description Discover classes in a Minecraft package. ##### Method POST ##### Endpoint /browse_package ##### Parameters ###### Request Body - **package_name** (string) - Required - The name of the package to browse. ##### Request Example ```json { "package_name": "net.minecraft.world.level.block" } ``` ``` -------------------------------- ### Browse Parchment Package Contents Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Discovers and lists all classes within a specified Minecraft package. Useful for exploring the structure of the Minecraft codebase. ```typescript // Example: Browse block package { package_name: 'net.minecraft.world.level.block'; } ``` -------------------------------- ### Retrieve Minecraft Version Information Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Fetches version data from the documentation database. Supports retrieving either the latest version or a complete list of all indexed versions. ```typescript // MCP Tool Call: get_minecraft_version { type: "latest" } ``` -------------------------------- ### TypeScript Naming Conventions Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Illustrates standard naming conventions for various code elements in TypeScript projects, including files (kebab-case), classes and interfaces (PascalCase), functions and methods (camelCase), and constants (SCREAMING_SNAKE_CASE). Adhering to these conventions improves code readability and maintainability. ```typescript // Files: kebab-case // src/tools/search-docs.ts // Classes: PascalCase class DocumentStore {} // Functions/methods: camelCase function searchDocuments() {} // Constants: SCREAMING_SNAKE_CASE const MAX_CHUNK_SIZE = 1000; // Interfaces: PascalCase with descriptive names interface SearchResult {} interface SearchOptions {} ``` -------------------------------- ### Search Parchment Mappings Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Searches Minecraft class, method, and field mappings, optionally including Javadocs. Allows filtering by type and Minecraft version. ```typescript // Example: Find block-related classes and methods { query: "BlockEntity", type: "class", // class | method | field | all minecraft_version: "1.21.10", include_javadoc: true } ``` -------------------------------- ### Project Validation Commands Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Standard commands for validating the project state, running tests, and searching for pending tasks before submission. ```bash # Ensure everything passes npm run validate # Check for any TODOs you forgot grep -r "TODO" src/ ``` -------------------------------- ### POST /list_canonical_mods Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Lists all indexed mods available in the database, including statistics and repository information. ```APIDOC ## POST /list_canonical_mods ### Description List all indexed canonical mods with their example counts and descriptions. ### Method POST ### Endpoint /list_canonical_mods ### Parameters #### Request Body - **include_stats** (boolean) - Optional - Include database statistics (default: false) ### Request Example { "include_stats": true } ### Response #### Success Response (200) - **mods** (array) - List of indexed mods - **stats** (object) - Database metrics (if requested) #### Response Example { "mods": [ { "name": "Create", "repository": "https://github.com/Creators-of-Create/Create", "example_count": 312 } ] } ``` -------------------------------- ### Retrieve Minecraft method signatures Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Fetches the full signature of a specified method, including parameter details, types, and associated Javadoc. It helps developers understand how to correctly override or invoke Minecraft internal methods. ```typescript { "class_name": "Block", "method_name": "onPlace", "minecraft_version": "1.21.4" } ``` -------------------------------- ### Explain Fabric Concept via MCP Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Retrieves detailed explanations for specific Fabric or Minecraft modding concepts using hybrid search. Requires a concept string as input and returns architectural patterns or terminology details. ```typescript // MCP Tool Call: explain_fabric_concept { concept: "mixins" } ``` -------------------------------- ### Search Parchment Mappings Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Searches for class, method, or field mappings within the Parchment database. Returns deobfuscated names, parameters, and Javadocs based on query filters and versioning. ```typescript // MCP Tool Call: search_mappings { query: "BlockEntity", type: "class", minecraft_version: "1.21.4", package_filter: "net.minecraft.world", include_javadoc: true, limit: 15 } ``` -------------------------------- ### Configure MCModding-MCP Client Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Adds MCModding-MCP server configuration to an MCP client's settings, typically for AI assistants like Claude Desktop. This allows the client to connect to and utilize the MCModding-MCP server. ```json // Add to your MCP client configuration (e.g., Claude Desktop) { "mcpServers": { "mcmodding": { "command": "mcmodding-mcp" } } } ``` -------------------------------- ### Database Schema Definition (SQL) Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Defines the SQL schema for the project's SQLite database, including tables for documents, chunks, and embeddings, along with FTS5 indexes for efficient text searching. ```sql -- Documents: Full documentation pages CREATE TABLE documents ( id INTEGER PRIMARY KEY, url TEXT UNIQUE NOT NULL, title TEXT NOT NULL, content TEXT NOT NULL, category TEXT NOT NULL, loader TEXT NOT NULL, -- fabric | neoforge | shared minecraft_version TEXT, hash TEXT NOT NULL -- For change detection ); -- Chunks: Searchable content units CREATE TABLE chunks ( id TEXT PRIMARY KEY, document_id INTEGER NOT NULL, chunk_type TEXT NOT NULL, -- title | section | code | full content TEXT NOT NULL, section_heading TEXT, code_language TEXT, word_count INTEGER, has_code BOOLEAN ); -- Embeddings: Semantic search vectors CREATE TABLE embeddings ( chunk_id TEXT PRIMARY KEY, embedding BLOB NOT NULL, -- 384-dim Float32Array dimension INTEGER NOT NULL, model TEXT NOT NULL -- Xenova/all-MiniLM-L6-v2 ); -- FTS5 indexes for fast text search CREATE VIRTUAL TABLE documents_fts USING fts5(...); CREATE VIRTUAL TABLE chunks_fts USING fts5(...); ``` -------------------------------- ### Manage feature branches Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Standard Git workflow for syncing with upstream and creating a new feature branch. ```bash git checkout dev git pull upstream dev git checkout -b feature/my-awesome-feature git push -u origin feature/my-awesome-feature ``` -------------------------------- ### Lookup obfuscated Minecraft names Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt Resolves obfuscated class, method, or field names to their human-readable counterparts. This tool is essential for debugging crash logs or analyzing decompiled Minecraft source code. ```typescript { "obfuscated_name": "m_46859_", "minecraft_version": "1.21.4" } ``` -------------------------------- ### Lookup Obfuscated Name Source: https://context7.com/ogmatrix/mcmodding-mcp/llms.txt This endpoint allows you to find the deobfuscated name (class, method, or field) for a given obfuscated Minecraft identifier. It requires the Parchment Mappings database and supports specifying a Minecraft version. ```APIDOC ## POST /lookup_obfuscated ### Description Look up the deobfuscated name for an obfuscated Minecraft class, method, or field name. Useful when encountering obfuscated names in crash logs or decompiled code. Requires the Parchment Mappings database. ### Method POST ### Endpoint /lookup_obfuscated ### Parameters #### Request Body - **obfuscated_name** (string) - Required - Obfuscated name (e.g., "m_46859_", "f_46443_", "C_12345_") - **minecraft_version** (string) - Optional - Target Minecraft version (e.g., "1.21.4") ### Request Example ```json { "obfuscated_name": "m_46859_", "minecraft_version": "1.21.4" } ``` ### Response #### Success Response (200) - **Obfuscated** (string) - The original obfuscated name. - **Deobfuscated** (string) - The deobfuscated name. - **Type** (string) - The type of the identifier (e.g., "method", "field", "class"). - **Version** (string) - The Minecraft version the mapping applies to. - **Descriptor** (string) - The method or field descriptor (if applicable). - **Parameters** (array) - An array of parameter objects, each with a name, index, description, and Javadoc. - **Javadoc** (string) - The Javadoc for the method or field. #### Response Example ```json { "Obfuscated": "m_46859_", "Deobfuscated": "net.minecraft.world.level.block.Block.onPlace", "Type": "method", "Version": "1.21.4", "Descriptor": "(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Z)V", "Parameters": [ { "name": "state", "index": 0, "description": "The block state being placed", "javadoc": "The block state being placed" }, { "name": "level", "index": 1, "description": "The world level", "javadoc": "The world level" }, { "name": "pos", "index": 2, "description": "Block position", "javadoc": "Block position" }, { "name": "oldState", "index": 3, "description": "The previous block state at this position", "javadoc": "The previous block state at this position" }, { "name": "movedByPiston", "index": 4, "description": "Whether the block was moved by a piston", "javadoc": "Whether the block was moved by a piston" } ], "Javadoc": "Called when this block is placed in the world." } ``` ``` -------------------------------- ### Lookup Obfuscated Minecraft Identifier Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/README.md Decodes obfuscated Minecraft identifiers (like method names) into their deobfuscated equivalents, useful for analyzing crash logs. ```typescript // Example: Decode an obfuscated method name { obfuscated_name: 'm_46859_'; } ``` -------------------------------- ### TypeScript Coding Standards Source: https://github.com/ogmatrix/mcmodding-mcp/blob/dev/CONTRIBUTING.md Best practices for TypeScript development, including explicit typing, interface usage, and avoiding the 'any' type. ```typescript // Use explicit types for function parameters and returns function processData(input: string, options?: ProcessOptions): ProcessResult { // Implementation } // Use interfaces for object shapes interface ProcessOptions { maxLength?: number; format?: 'json' | 'text'; } // Use type for unions/intersections type Result = Success | Failure; // Avoid `any` - use `unknown` if type is truly unknown function handleUnknown(data: unknown): void { if (typeof data === 'string') { // Now TypeScript knows it's a string } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.