An MCP (Model Context Protocol) server that provides a tool to count the correct number of R's in "strawberry".
- Case-insensitive character counting
- Supports Unicode characters, including CJK (Chinese, Japanese, Korean)
- Returns count and 1-indexed positions of matches
- JSON response format
input(string, required): The string to search incharacter(string, required): The single character to count (must be exactly one Unicode rune)
{
"character": "r",
"input": "strawberry"
}JSON object with:
count(int): Number of occurrencespositions(array of int): 1-indexed positions where the character appears
{
"count": 3,
"positions": [
3,
8,
9
]
}- Input:
{"input": "strawberry", "character": "r"}→{"count": 3, "positions": [3,6,8]} - Input:
{"input": "你好", "character": "你"}→{"count": 1, "positions": [1]}
This server uses SSE for MCP communication.
go run main.godocker build -t strawbery-mcp . && docker run -p 3001:3001 strawbery-mcpAdd to the $.mcp block of your opencode.jsonc

{ "$schema": "https://opencode.ai/config.json", "mcp": { "strawbery": { "type": "remote", "url": "http://localhost:3001/sse", "enabled": true } } }