inecta-food-knowledge-mcp
Version:
MCP server for INECTA Food Knowledge Base - semantic search and dependency analysis for Business Central AL code and documentation
204 lines (146 loc) • 5.53 kB
Markdown
# inecta Food Knowledge Base MCP Server
MCP server providing 11 tools for semantic search and dependency analysis of Business Central documentation, code, and inecta University user manuals.
> **Full Documentation**: See [TECHNICAL.md](../TECHNICAL.md) in the parent directory for system architecture, deployment, and operations.
## Quick Start
Add to Claude Desktop config and restart:
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"inecta-food-knowledge": {
"command": "npx",
"args": ["-y", "inecta-food-knowledge-mcp@latest"],
"env": {
"API_URL": "<API URL>",
"API_TOKEN": "<API TOKEN>"
}
}
}
}
```
The server auto-installs and auto-updates via npx. Contact inecta for API credentials.
## Environment Variables (Optional)
| Variable | Description |
|----------|-------------|
| `API_URL` | Override backend API URL |
| `API_TOKEN` | Override API authentication token |
Default credentials are built-in for inecta users. Contact inecta support for custom API access.
## Available Tools (11 total)
### Group 1: Search & Content (4 tools)
| Tool | Description |
|------|-------------|
| `search_knowledge_base` | Hybrid semantic + keyword search across all content |
| `search_code` | AL source code search with complexity filtering |
| `find_similar_code` | Find similar implementations using vector similarity |
| `get_document_content` | Fetch full document content by ID |
### Group 2: Discovery (1 tool)
| Tool | Description |
|------|-------------|
| `list_modules` | List available BC modules in the knowledge base |
### Group 3: Object Registry (2 tools)
| Tool | Description |
|------|-------------|
| `get_object_info` | Unified object lookup by ID (37M or 50K range) or name |
| `get_next_available_id` | Get next available object ID for a module |
### Group 4: Dependency Analysis (2 tools)
| Tool | Description |
|------|-------------|
| `get_dependencies` | Object dependency analysis (what calls what) |
| `generate_call_graph` | Generate Mermaid call graph diagrams |
### Group 5: Advanced Analysis (2 tools)
| Tool | Description |
|------|-------------|
| `map_event_chain` | Map event publisher/subscriber chains |
| `analyze_table_usage` | Analyze which objects read/write to a table |
---
## Tool Reference
### search_knowledge_base
Primary search tool with hybrid semantic + BM25 search.
**Parameters**:
- `query` (required): Natural language search query
- `audience`: Target audience (`developer`, `end_user`, `functional_user`)
- `content_types`: Filter by content type:
- `l1_documentation` - Technical reference
- `l2_documentation` - User guides
- `al_code` - AL source code
- `university_article` - inecta University articles
- `modules`: Array of modules to filter by
- `top_k`: Number of results (default: 5, max: 20)
### get_object_info
Unified AL object lookup. Accepts object ID (37M range or 50K range) OR object name.
**Parameters**:
- `identifier` (required): Object ID or object name
- `object_type` (required): `codeunit`, `table`, `page`, `report`, `tableextension`, `pageextension`, `enum`, `query`
- `module`: Optional module filter (useful to disambiguate conflicts)
**Returns**: Object name, both ID formats, module, and file path.
**Examples**:
```
get_object_info("37009705", "codeunit") → lookup by 37M ID
get_object_info("59705", "codeunit") → lookup by 50K ID (same object)
get_object_info("CaseManagementFunctionsINE", "codeunit") → lookup by name
```
### get_dependencies
Analyze object dependencies.
**Parameters**:
- `module` (required): Module name (e.g., "YPRODO")
- `object_type` (required): `codeunit`, `table`, `page`, or `report`
- `object_id` (required): Object ID (e.g., "37010147")
- `depth`: Dependency depth (default: 1)
### search_code
Search AL source code with additional filtering.
**Parameters**:
- `query` (required): Code search query
- `module`: Optional module filter
- `object_type`: Optional object type filter
- `complexity`: Filter by code complexity (`simple`, `medium`, `complex`)
- `top_k`: Number of results (default: 5)
### map_event_chain
Map event publisher/subscriber chains.
**Parameters**:
- `event_name` (required): Event name to search for (partial match supported)
- `publisher_module`: Optional publisher module filter
- `publisher_object_id`: Optional publisher object ID filter
### analyze_table_usage
Analyze which objects interact with a table.
**Parameters**:
- `table_name`: Table name (partial match supported)
- `table_id`: Table ID (exact match)
- `operation_types`: Filter by operations (`read`, `insert`, `modify`, `delete`)
- `limit`: Maximum results (default: 100)
---
## Development
```bash
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run dev
```
## Publishing
```bash
npm version patch
npm run build
npm publish
```
## Architecture
```
Claude Desktop
↓ MCP Protocol (stdio)
This MCP Server
↓ HTTP REST API
Backend API (Express.js)
↓
Pinecone + BM25 + Voyage AI + GCS + SQLite
```
## Changelog
### v0.2.0 (2025-11-28)
- Reorganized tools into 5 logical groups
- Added `get_object_info` (unified object lookup, replaces `get_object_name` and `get_object_id`)
- Removed deprecated tools: `trace_call_stack`, `find_dead_code`
- Now 11 tools total
### v0.1.x
- Initial release with 14 tools
## License
UNLICENSED - Internal inecta use only