MCP Text Transform Server

by msv2017

285 downloads Not rated yet

About

# MCP Text Transform Server A **Model Context Protocol (MCP) server** implementation in C# .NET 9 that provides text transformation tools. This server is compatible with Claude Desktop and other MCP clients. > 📖 **Learn more about MCP**: Visit the [official Model Context Protocol…

Explore

This MCP server provides two powerful text transformation tools:

1. CapitalCase Tool (capital_case)
- Converts text to Capital Case (Title Case) format
- Handles camelCase/PascalCase by intelligently adding spaces
- Example: "camelCaseExample" → "Camel Case Example"

2. SnakeCase Tool (snake_case)
- Converts text to snake_case format
- Handles camelCase, PascalCase, and spaces
- Example: "HelloWorld" → "hello_world"

- .NET 9.0 SDK or later
- Claude Desktop (for testing MCP integration)

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

{
  "mcpServers": {
    "text-transform": {
      "command": "dotnet",
      "args": [
        "run",
        "--project",
        "/path/to/your/test-mcp-server/McpServer.csproj",
        "--no-build"
      ]
    }
  }
}

Replace /path/to/your/test-mcp-server with your actual project path:

Windows example:

{
"mcpServers": {
"text-transform": {
"command": "dotnet",
"args": [
"run",
"--project",
"C:\\Users\\YourName\\projects\\test-mcp-server\\McpServer.csproj",
"--no-build"
]
}
}
}

macOS/Linux example:

{
"mcpServers": {
"text-transform": {
"command": "dotnet",
"args": [
"run",
"--project",
"/home/username/projects/test-mcp-server/McpServer.csproj",
"--no-build"
]
}
}
}

Important notes:
- Use absolute paths to the McpServer.csproj file
- Use double backslashes (\\) on Windows for JSON escaping
- Ensure the project file path exists
- The --no-build flag speeds up server startup (recommended)

Location of config file:
- Windows: %APPDATA%\Claude\claude_desktop_config.json
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Linux: ~/.config/Claude/claude_desktop_config.json

Exact configuration format:

{
"mcpServers": {
"text-transform": {
"command": "dotnet",
"args": [
"run",
"--project",
"/path/to/your/test-mcp-server/McpServer.csproj",
"--no-build"
]
}
}
}

Replace /path/to/your/test-mcp-server with your actual project path:

Windows:

"args": [
"run",
"--project",
"C:\\Users\\YourName\\projects\\test-mcp-server\\McpServer.csproj",
"--no-build"
]

macOS/Linux:

"args": [
"run",
"--project",
"/home/username/projects/test-mcp-server/McpServer.csproj",
"--no-build"
]

Important notes:
- Use absolute paths to the McpServer.csproj file
- Use double backslashes (\\) on Windows for JSON escaping
- Ensure the project file path exists and is correct
- The command should be dotnet (not full path)

The server provides these text transformation capabilities:

Input: "camelCaseExample"
├── CapitalCase → "Camel Case Example"  
└── SnakeCase   → "camel_case_example"

Input: "Hello World"
├── CapitalCase → "Hello World"
└── SnakeCase → "hello_world"

To add new MCP tools, simply add methods to the TextTransformTools class:

[McpServerTool]
[Description("Your tool description")]
public static string YourTool([Description("Input parameter")] string input)
{
    // Your transformation logic
    return transformedText;
}

echo '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}' | dotnet run

echo '{"jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": {"name": "CapitalCase", "arguments": {"text": "hello world"}}}' | dotnet run
```

Check Claude Desktop logs:
- Windows: Look in Event Viewer or Claude's application data folder
- macOS: Use Console.app to view logs
- Linux: Check system logs or run Claude from terminal

A Model Context Protocol (MCP) server implementation in C# .NET 9 that provides text transformation tools. This server is compatible with Claude Desktop and other MCP clients.

> 📖 Learn more about MCP: Visit the official Model Context Protocol documentation for comprehensive guides and examples.

✨ Features

This MCP server provides two powerful text transformation tools:

1. CapitalCase Tool (capital_case)
- Converts text to Capital Case (Title Case) format
- Handles camelCase/PascalCase by intelligently adding spaces
- Example: "camelCaseExample" → "Camel Case Example"

2. SnakeCase Tool (snake_case)
- Converts text to snake_case format
- Handles camelCase, PascalCase, and spaces
- Example: "HelloWorld" → "hello_world"

🏗️ Architecture

This project uses the official Model Context Protocol SDK and follows modern C# practices:

- MCP Protocol Compliance: Uses ModelContextProtocol NuGet package
- STDIO Transport: Communicates via standard input/output (JSON-RPC)
- Attribute-Based Tools: Simple [McpServerTool] decoration
- Dependency Injection: Built-in .NET DI container
- Structured Logging: Configured for MCP compatibility (stderr)
- Modern C# Features: .NET 9, nullable reference types, async patterns

📁 Project Structure

McpServer/
├── Tools/                     # MCP tool implementations
│   └── TextTransformTools.cs  # Capital case & snake case tools
├── Program.cs                 # MCP server entry point
├── McpServer.csproj          # Project file with MCP SDK
└── README.md                 # This documentation

🚀 Getting Started

Prerequisites

- .NET 9.0 SDK or later
- Claude Desktop (for testing MCP integration)

Building the Server

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.