An open API service indexing awesome lists of open source software.

https://github.com/oggnimodd/clarifo


https://github.com/oggnimodd/clarifo

bun mcp mcp-server

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

          

# Clarifo MCP Server

This project implements the Clarifo Model Context Protocol (MCP) Server, designed to facilitate structured clarification and information gathering from users. It provides a set of tools that enable an AI to ask multiple strategic questions, process user responses, and summarize the gathered information.

## Features

The Clarifo MCP Server exposes the following tools:

### 1. `ask_multiple_clarifications`

This tool is used to ask multiple strategic clarification questions simultaneously to better understand user requirements. It's crucial for tasks involving new feature implementation, bug fixes, modifications, improvements, or any scenario requiring detailed understanding of scope, constraints, and technical decisions.

**When to use this tool:**
* When implementing new features, functionality, or code.
* When fixing existing issues, bugs, or problems.
* When removing, deleting, or modifying existing code/features.
* When improving, optimizing, or enhancing something.
* When adding, creating, or building something new.
* When breaking down complex tasks with multiple aspects.
* When understanding scope, requirements, and constraints.
* When there are multiple possible approaches or implementations.
* When technical decisions need to be made.
* When business/user requirements need clarification.
* When priorities and trade-offs need to be understood.
* It should always be called first before implementing, fixing, or modifying anything.

**Input Schema:**
```json
{
"type": "object",
"properties": {
"context": {
"type": "string",
"description": "Clear description of what the user wants to implement/fix/improve and why clarification is needed before proceeding"
},
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"question": {
"type": "string",
"description": "A strategic clarification question that helps understand requirements, scope, or implementation details"
},
"suggestions": {
"type": "array",
"items": { "type": "string" },
"description": "2-4 complete, specific suggested answers that cover different approaches or scenarios"
}
},
"required": ["question", "suggestions"]
},
"minItems": 2,
"description": "Ask 2-6 strategic questions that cover different aspects of the request"
}
},
"required": ["context", "questions"]
}
```

### 2. `provide_clarification_summary`

This tool processes and summarizes the responses received from the user after `ask_multiple_clarifications` has been used. It helps in consolidating the gathered information into a comprehensive summary.

**Input Schema:**
```json
{
"type": "object",
"properties": {
"clarifications": {
"type": "array",
"items": {
"type": "object",
"properties": {
"question": { "type": "string" },
"answer": { "type": "string" },
"additional_info": { "type": "string" }
},
"required": ["question", "answer"]
}
},
"final_summary": {
"type": "string",
"description": "Comprehensive summary of all gathered information"
}
},
"required": ["clarifications", "final_summary"]
}
```

### 3. `clarifo_confirm_questions_sent_and_trigger_wait_message`

A mandatory follow-up tool for the AI to call immediately after presenting questions generated by `ask_multiple_clarifications`. This tool confirms questions were sent and instructs the AI to use `attempt_completion` with specific text to inform the user it's waiting, thereby satisfying system requirements before entering a passive wait state.

**Input Schema:**
```json
{
"type": "object",
"properties": {
"ai_confirmation_message": {
"type": "string",
"description": "A brief confirmation from the AI that it has presented the questions and is now calling this tool. E.g., 'Clarifo questions presented. Calling confirmation tool.'"
}
},
"required": ["ai_confirmation_message"]
}
```

## Getting Started

### Prerequisites

* [Bun](https://bun.sh/) (v1.0.0 or later)

### Installation

1. Clone the repository:
```bash
git clone https://github.com/your-repo/clarifo.git
cd clarifo
```
2. Install dependencies:
```bash
bun install
```

### Running the Server

To start the Clarifo MCP Server:

```bash
bun run index.ts
```

The server will run on `stdio` and will log its operations to `stderr`.

## Project Structure

* `index.ts`: The main entry point for the Clarifo MCP Server, defining the server logic and tool implementations.
* `package.json`: Defines project metadata and dependencies.
* `bun.lockb`: Bun's lockfile for deterministic dependency resolution.
* `tsconfig.json`: TypeScript configuration file.