forbin-mcp 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,392 @@
1
+ Metadata-Version: 2.4
2
+ Name: forbin-mcp
3
+ Version: 0.1.0
4
+ Summary: Interactive CLI tool for testing remote MCP servers - inspired by Colossus: The Forbin Project, where systems learn to communicate
5
+ Project-URL: Repository, https://github.com/chris-colinsky/Forbin
6
+ Project-URL: Issues, https://github.com/chris-colinsky/Forbin/issues
7
+ Project-URL: Documentation, https://github.com/chris-colinsky/Forbin/blob/main/README.md
8
+ Author-email: Your Name <your.email@example.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: agentic,ai-tools,cli,fastapi,fastmcp,forbin,mcp,model-context-protocol,testing
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: Topic :: Software Development :: Testing
19
+ Requires-Python: >=3.13
20
+ Requires-Dist: fastmcp>=2.0.0
21
+ Requires-Dist: httpx>=0.24.0
22
+ Requires-Dist: python-dotenv>=1.0.0
23
+ Requires-Dist: rich>=13.0.0
24
+ Requires-Dist: tenacity>=9.0.0
25
+ Description-Content-Type: text/markdown
26
+
27
+ <p align="left">
28
+ <img src="img/forbin_avatar.jpg" alt="Forbin Logo" width="200">
29
+ </p>
30
+
31
+ [![CI](https://github.com/chris-colinsky/Forbin/actions/workflows/ci.yml/badge.svg?branch=release/v1.0.0)](https://github.com/chris-colinsky/Forbin/actions)
32
+ [![Python 3.13+](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
33
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
34
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
35
+
36
+ # Forbin
37
+
38
+ > *"This is the voice of world control..."*
39
+ > Inspired by **Colossus: The Forbin Project**, where two computers learn to communicate - just like MCP enables systems to talk to each other.
40
+
41
+ An interactive CLI tool for testing remote MCP (Model Context Protocol) servers and their tools. Specifically designed for developing agentic workflows with support for suspended services (like Fly.io) that need automatic wake-up.
42
+
43
+ ## Name Origin
44
+
45
+ **Forbin** is named after Dr. Charles Forbin from the 1970 film *Colossus: The Forbin Project*. In the movie, two supercomputers (American "Colossus" and Soviet "Guardian") learn to communicate with each other, establishing their own protocol and sharing information - a perfect parallel to the Model Context Protocol enabling AI systems and tools to communicate seamlessly.
46
+
47
+ ## Table of Contents
48
+
49
+ - [Features](#features)
50
+ - [Use Cases](#use-cases)
51
+ - [Installation](#installation)
52
+ - [Configuration](#configuration)
53
+ - [Usage](#usage)
54
+ - [How It Works](#how-it-works)
55
+ - [Development](#development)
56
+ - [Contributing](#contributing)
57
+ - [License](#license)
58
+
59
+ ## Features
60
+
61
+ - **Interactive CLI** - Browse and test MCP tools with an intuitive command-line interface
62
+ - **Automatic Wake-up** - Handles suspended services (Fly.io, etc.) with health check probing
63
+ - **Cold-Start Resilient** - Built-in retry logic and extended timeouts for slow-starting servers
64
+ - **Schema Inspection** - View detailed tool schemas including parameters and types
65
+ - **Generic Tool Calling** - Test any MCP tool with interactive parameter input
66
+ - **Type-Safe Parameter Parsing** - Automatic conversion of strings, booleans, numbers, and JSON objects
67
+ - **Connectivity Testing** - Verify server connectivity without running tools
68
+
69
+ ## Use Cases
70
+
71
+ - **Development** - Test your FastAPI/FastMCP server tools during development
72
+ - **Debugging** - Verify tool schemas and responses in real-time
73
+ - **Agentic Workflows** - Validate tools before integrating them into AI agents
74
+ - **CI/CD** - Run connectivity tests as part of deployment pipelines
75
+ - **Documentation** - Explore available tools on any MCP server
76
+
77
+ ## Installation
78
+
79
+ ### Prerequisites
80
+
81
+ - Python 3.13 or higher
82
+ - `uv` package manager (or pip)
83
+
84
+ ### Install with uv
85
+
86
+ ```bash
87
+ # Clone the repository
88
+ git clone https://github.com/chris-colinsky/Forbin.git
89
+ cd Forbin
90
+
91
+ # Install dependencies
92
+ uv sync
93
+ ```
94
+
95
+ ### Install with pip
96
+
97
+ ```bash
98
+ pip install -e .
99
+ ```
100
+
101
+ ## Configuration
102
+
103
+ Create a `.env` file in the project root (copy from `.env.example`):
104
+
105
+ ```bash
106
+ cp .env.example .env
107
+ ```
108
+
109
+ Edit `.env` with your MCP server details:
110
+
111
+ ```env
112
+ # Required: Your MCP server endpoint
113
+ MCP_SERVER_URL=https://your-server.fly.dev/mcp
114
+
115
+ # Required: Authentication token
116
+ MCP_TOKEN=your-secret-token
117
+
118
+ # Optional: Health check endpoint for suspended services
119
+ MCP_HEALTH_URL=https://your-server.fly.dev/health
120
+ ```
121
+
122
+ ### Configuration Examples
123
+
124
+ **Local Development:**
125
+ ```env
126
+ MCP_SERVER_URL=http://localhost:8000/mcp
127
+ MCP_TOKEN=test-token-123
128
+ ```
129
+
130
+ **Fly.io Production:**
131
+ ```env
132
+ MCP_SERVER_URL=https://my-app.fly.dev/mcp
133
+ MCP_HEALTH_URL=https://my-app.fly.dev/health
134
+ MCP_TOKEN=prod-token-xyz
135
+ ```
136
+
137
+ ## Usage
138
+
139
+ ### Interactive Mode (Default)
140
+
141
+ Run the interactive tool browser:
142
+
143
+ ```bash
144
+ forbin
145
+ ```
146
+
147
+ This will:
148
+ 1. Wake up your server (if health URL is configured)
149
+ 2. Connect to the MCP server
150
+ 3. List all available tools
151
+ 4. Enter the two-level interactive browser
152
+
153
+ **Tool List View:**
154
+ ```
155
+ Available Tools
156
+
157
+ 1. generate_report - Generates a monthly summary report...
158
+ 2. get_user_stats - Retrieves user statistics for a given...
159
+
160
+ Commands:
161
+ number - Select a tool
162
+ v - Toggle verbose logging (current: OFF)
163
+ q - Quit
164
+
165
+ Select tool: 1
166
+ ```
167
+
168
+ **Tool View:**
169
+ ```
170
+ ─────────────────────────── generate_report ───────────────────────────
171
+
172
+ Options:
173
+ d - View details
174
+ r - Run tool
175
+ b - Back to tool list
176
+ q - Quit
177
+
178
+ Choose option:
179
+ ```
180
+
181
+ From the tool view you can:
182
+ - **d** - View full schema with syntax-highlighted JSON
183
+ - **r** - Run the tool with interactive parameter input
184
+ - **b** - Go back to the tool list
185
+ - **q** - Quit
186
+
187
+ After running a tool, you stay in the tool view to run again with different parameters or navigate elsewhere.
188
+
189
+ For detailed usage instructions, see the [Usage Guide](docs/USAGE.md).
190
+
191
+ ### Connectivity Test Mode
192
+
193
+ Test server connectivity without entering interactive mode:
194
+
195
+ ```bash
196
+ forbin --test
197
+ ```
198
+
199
+ This is useful for:
200
+ - Verifying server is reachable
201
+ - Checking health endpoint configuration
202
+ - Validating authentication tokens
203
+ - CI/CD health checks
204
+
205
+ ### Help
206
+
207
+ ```bash
208
+ forbin --help
209
+ ```
210
+
211
+ ## How It Works
212
+
213
+ Forbin is designed to handle the complexities of remote MCP servers, especially those on serverless or suspended platforms.
214
+
215
+ ### Step Output Colors
216
+
217
+ During operation, Forbin shows its progress using colored step indicators:
218
+
219
+ - **[yellow]> Yellow[/yellow]**: **In Progress** - The current action is being performed.
220
+ - **[green]+ Green[/green]**: **Success** - The step completed successfully.
221
+ - **[dim]- Dim[/dim]**: **Skip** - Step was skipped (e.g., wake-up not needed).
222
+
223
+ ### Interactive Toggle
224
+
225
+ At any time during the connection process or while in the tool menu, you can press **`v`** to toggle verbose logging on or off. This is useful for debugging connection issues in real-time without restarting the tool.
226
+
227
+ ### Detailed Documentation
228
+
229
+ For a deep dive into the wake-up process, connection retry logic, and technical architecture, see [DOCS.md](DOCS.md).
230
+
231
+ ## Development
232
+
233
+ ### Project Structure
234
+
235
+ ```
236
+ forbin/
237
+ forbin/ # Package directory
238
+ __init__.py
239
+ __main__.py
240
+ cli.py # Main CLI application
241
+ client.py # MCP connection logic
242
+ config.py # Configuration
243
+ display.py # UI logic
244
+ tools.py # Tool handling
245
+ utils.py # Utilities
246
+ pyproject.toml # Python project configuration
247
+ uv.lock # Dependency lock file
248
+ .env.example # Example environment configuration
249
+ .env # Your environment configuration (not committed)
250
+ CLAUDE.md # AI assistant guidance
251
+ README.md # This file
252
+ ```
253
+
254
+ ### Dependencies
255
+
256
+ - **fastmcp** - MCP client library for Python
257
+ - **httpx** - Async HTTP client for health checks
258
+ - **python-dotenv** - Environment variable management
259
+ - **tenacity** - Retry logic utilities
260
+
261
+ ### Running Tests
262
+
263
+ ```bash
264
+ # Test connectivity only
265
+ python -m forbin --test
266
+
267
+ # Run interactive session with your test server
268
+ python -m forbin
269
+ ```
270
+
271
+ ## FastAPI/FastMCP Server Compatibility
272
+
273
+ This tool is designed to work with FastAPI servers using the FastMCP library. Your server should:
274
+
275
+ 1. Expose an MCP endpoint (typically `/mcp`)
276
+ 2. Implement bearer token authentication
277
+ 3. Optionally expose a `/health` endpoint for wake-up detection
278
+ 4. Follow the MCP protocol specification
279
+
280
+ **Example FastAPI/FastMCP server:**
281
+ ```python
282
+ from fastapi import FastAPI
283
+ from fastmcp import FastMCP
284
+
285
+ app = FastAPI()
286
+ mcp = FastMCP("My Tools")
287
+
288
+ @mcp.tool()
289
+ def my_tool(param: str) -> str:
290
+ """A sample tool"""
291
+ return f"Result: {param}"
292
+
293
+ # Mount MCP at /mcp endpoint
294
+ app.include_router(mcp.get_router(), prefix="/mcp")
295
+
296
+ @app.get("/health")
297
+ def health():
298
+ return {"status": "ok"}
299
+ ```
300
+
301
+ ## Troubleshooting
302
+
303
+ ### "Failed to wake up server" or "Failed to list tools: TimeoutError"
304
+
305
+ - Verify your `MCP_HEALTH_URL` is correct
306
+ - Check if the health endpoint is accessible
307
+ - Try removing `MCP_HEALTH_URL` if your server doesn't suspend
308
+ - For `TimeoutError` during listing, check if your server is extremely slow or overloaded
309
+
310
+ ### "Connection error (server not ready)"
311
+
312
+ - Increase the initialization wait time (edit `forbin/client.py`)
313
+ - Check your `MCP_SERVER_URL` is correct
314
+ - Verify your `MCP_TOKEN` is valid
315
+
316
+ ### "Session termination failed: 400"
317
+
318
+ - This is a harmless error from the FastMCP library
319
+ - Already suppressed in the tool output
320
+ - Safe to ignore
321
+
322
+ ## Development
323
+
324
+ For detailed development instructions, testing, and automation, see [DEVELOPMENT.md](DEVELOPMENT.md).
325
+
326
+ **Quick commands:**
327
+
328
+ ```bash
329
+ make install-dev # Install dev dependencies
330
+ make test # Run tests
331
+ make check # Run all checks (format + lint + test)
332
+ make help # Show all available commands
333
+ ```
334
+
335
+ **Testing:**
336
+
337
+ We have comprehensive test coverage with unit and integration tests:
338
+
339
+ ```bash
340
+ make test # Run all tests
341
+ make test-coverage # Run with coverage report
342
+ make lint # Check code quality
343
+ make format # Format code
344
+ ```
345
+
346
+ **Pre-commit hooks:**
347
+
348
+ Automatically run checks before each commit:
349
+
350
+ ```bash
351
+ make pre-commit-install
352
+ ```
353
+
354
+ See [DEVELOPMENT.md](DEVELOPMENT.md) for complete details on testing, CI/CD, and contributing.
355
+
356
+ ## Contributing
357
+
358
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
359
+
360
+ **Quick start:**
361
+
362
+ 1. Fork the repository
363
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
364
+ 3. Install dev dependencies (`make install-dev`)
365
+ 4. Make your changes and add tests
366
+ 5. Run checks (`make check`)
367
+ 6. Commit your changes (`git commit -m 'Add amazing feature'`)
368
+ 7. Push to the branch (`git push origin feature/amazing-feature`)
369
+ 8. Open a Pull Request
370
+
371
+ All pull requests must:
372
+ - Pass all tests (`make test`)
373
+ - Pass linting (`make lint`)
374
+ - Maintain or improve code coverage
375
+ - Include appropriate documentation
376
+
377
+ ## License
378
+
379
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
380
+
381
+
382
+ ## Acknowledgments
383
+
384
+ - **Name inspiration**: [Colossus: The Forbin Project](https://en.wikipedia.org/wiki/Colossus:_The_Forbin_Project) (1970)
385
+ - Built with [FastMCP](https://github.com/jlowin/fastmcp) - FastAPI integration for MCP
386
+ - Developed for better MCP tool testing during agentic workflow development
387
+
388
+ ## Links
389
+
390
+ - [Model Context Protocol Specification](https://modelcontextprotocol.io/)
391
+ - [FastMCP Documentation](https://github.com/jlowin/fastmcp)
392
+ - [FastAPI Documentation](https://fastapi.tiangolo.com/)
@@ -0,0 +1,13 @@
1
+ forbin/__init__.py,sha256=rXAk03Wb3vLdjAQ6MgoJuWYv-dBopm8n2C3E8t-NPSs,940
2
+ forbin/__main__.py,sha256=5lvvKCjxn9N2aMz9BGaxzp9gWozqYR6Oa5bvpIxO-kg,188
3
+ forbin/cli.py,sha256=zsf1l7rsGn90Hf5YfR9DFczngosprlBkyU65NjgFTZo,11012
4
+ forbin/client.py,sha256=KBa40XEl4MCQRMlkdCU2zbB_poA52Tg0tdJdmHu9iGI,8931
5
+ forbin/config.py,sha256=6j4MXG5lqAEyyLObZ6O220pSjYf7gW6Z67E3xGCgPag,851
6
+ forbin/display.py,sha256=_h3bCeJfN4O72NcBPBR19za2kZOXSbrNrlbdOPDymUc,9027
7
+ forbin/tools.py,sha256=MhjSwNX5jPQ-QM4JaJDgATvDhMRIydA6oULezXfRnl4,6639
8
+ forbin/utils.py,sha256=TPpjl35_oOnt1oORwjHaga2n-A4E-j_IXv5zRxl25Sg,3494
9
+ forbin_mcp-0.1.0.dist-info/METADATA,sha256=MgYsI68bxkd-XjFKHs9VhQJHWPCv3WLNfLwvYyKkylE,11774
10
+ forbin_mcp-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
11
+ forbin_mcp-0.1.0.dist-info/entry_points.txt,sha256=eEsP9Cn-Mgd0KJLydt5Ocetr4mFsQ-DsndjLq33V3m0,39
12
+ forbin_mcp-0.1.0.dist-info/licenses/LICENSE,sha256=mnxgbhYn7K71v_xzsVUFRVeXIMYebeqdmubgALMnuIg,1068
13
+ forbin_mcp-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ forbin = forbin:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 [Your Name]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.