# MIDCON Backend SDK MCP Server

Model Context Protocol server providing AI-assisted development support for the MIDCON Backend SDK.

## Overview

This MCP server enables LLMs (like Claude) to provide instant access to SDK documentation, code examples, and best practices for developing plugins with the MIDCON Backend SDK.

## Features

- **SDK Documentation Access**: Query detailed information about SDK classes, interfaces, and methods
- **Code Examples**: Get working code samples for common use cases
- **Best Practices**: Learn recommended patterns and practices
- **Search Functionality**: Find relevant SDK components by keyword
- **Quick Start Guide**: Access the complete quick start documentation

## Available Tools

### `get_class_info`
Get detailed information about a specific SDK class or interface.

**Parameters:**
- `className` (string): Name of the class (e.g., "OdooPluginControllerBase", "IOdooUserService")

**Example:**
```json
{
  "className": "OdooPluginControllerBase"
}
```

### `search_sdk`
Search for SDK classes, methods, or concepts by keyword.

**Parameters:**
- `query` (string): Search query (e.g., "authentication", "metadata", "controller")

### `get_example`
Get a code example for a specific use case.

**Parameters:**
- `exampleName` (string): Name of the example
  - `basic-get-endpoint`
  - `post-with-validation`
  - `error-handling`
  - `dependency-injection`

### `list_classes`
List all available SDK classes and interfaces.

### `get_best_practices`
Get best practices for using the SDK.

### `get_quick_start`
Get the quick start guide for MIDCON Backend SDK.

## Installation

### Prerequisites

- .NET 10.0 SDK or later
- Claude Desktop or another MCP-compatible client

### Build

```bash
dotnet build
```

### Publish

```bash
dotnet publish -c Release -o publish
```

## Configuration

### Claude Desktop

Add the following to your Claude Desktop configuration file:

**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Linux:** `~/.config/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "midcon-backend-sdk": {
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "/absolute/path/to/midcon-backend-sdk-mcp/src/MidCon.Backend.Sdk.Mcp/MidCon.Backend.Sdk.Mcp.csproj"
      ]
    }
  }
}
```

Or use the published executable:

```json
{
  "mcpServers": {
    "midcon-backend-sdk": {
      "command": "/absolute/path/to/publish/MidCon.Backend.Sdk.Mcp",
      "args": []
    }
  }
}
```

## Usage Example

Once configured, you can ask Claude questions like:

- "What classes are available in the MIDCON Backend SDK?"
- "Show me how to create a plugin controller"
- "What are the best practices for using this SDK?"
- "Give me an example of error handling in a controller"
- "How do I access the authenticated user's API key?"

## Development

### Project Structure

```
midcon-backend-sdk-mcp/
├── src/
│   └── MidCon.Backend.Sdk.Mcp/
│       ├── Program.cs          # MCP server entry point
│       ├── SdkTools.cs         # Tool implementations
│       └── SdkData.cs          # SDK documentation data
├── README.md
└── CLAUDE.md                   # Development guidelines
```

### Adding New Documentation

To add new classes, examples, or best practices:

1. Edit `src/MidCon.Backend.Sdk.Mcp/SdkData.cs`
2. Add entries to the appropriate dictionary:
   - `Classes` for class/interface documentation
   - `Examples` for code examples
   - `BestPractices` for best practice guidelines
3. Rebuild the project

### Testing

Test the MCP server using the MCP Inspector or by integrating with Claude Desktop.

## Technical Stack

- **.NET 10.0**: Modern C# with top-level statements
- **ModelContextProtocol**: Official MCP SDK for .NET
- **stdio Transport**: Standard input/output for MCP communication

## License

MIT License - Copyright (c) 2026 Johann Dück

## Related Projects

- [MIDCON Backend SDK](https://github.com/JDueckMidCon/midcon-backend-sdk) - The SDK this server documents
- [Model Context Protocol](https://modelcontextprotocol.io/) - MCP specification
- [Claude Desktop](https://claude.ai/download) - AI assistant supporting MCP

## Support

For issues or questions:
- SDK Issues: [midcon-backend-sdk/issues](https://github.com/JDueckMidCon/midcon-backend-sdk/issues)
- MCP Server Issues: [midcon-backend-sdk-mcp/issues](https://github.com/JDueckMidCon/midcon-backend-sdk-mcp/issues)
