Compile a tools.txt spec into MCP tool definitions
Project description
Singleline is a compiler that takes a text file and spits out an MCP server. Write your tools as one-liners, get a working Python or TypeScript server on the other end.
No boilerplate. No wrappers. Just name:command and go.
Features
- Declarative tool definitions:
name:commandpairs - Parameters extracted automatically from
{placeholders} - Generates Python (
FastMCP) or TypeScript (@modelcontextprotocol/sdk) - Inline or standalone descriptions via the
#!prefix
Installation
Python 3.x and jinja2:
pip install jinja2
Usage
1. Write a tools.txt
#! List files in a directory
ls:ls -la {path}
#! Check system uptime
uptime:uptime
#! Run a custom bash command
bash: /usr/bin/env bash -c "{command}"
2. Compile
Python:
python singleline.py --mcp tools.txt --lang python > tools.py
TypeScript:
python singleline.py --mcp tools.txt --lang typescript > tools.ts
Command Line Arguments
| Argument | Short | Required | Description |
|---|---|---|---|
--mcp |
Yes | Path to the spec file | |
--lang |
Yes | python or typescript |
|
--output |
-o |
No | Output file (defaults to stdout) |
Spec Format
- Tool:
name:command - Parameters:
{like_this}in the command string becomes a tool input - Descriptions:
- Inline:
name:command #! Description here - Standalone:
#! Description hereon the line before the tool
- Inline:
- Comments: Lines starting with
#(but not#!) are ignored
Generated Code Requirements
Python: mcp (FastMCP)
TypeScript: @modelcontextprotocol/sdk, Node.js with child_process and util
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file onelinemcp-0.1.0.tar.gz.
File metadata
- Download URL: onelinemcp-0.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a3ada3f8736fbc578c7bfa487b938d1dfd8886a9c8fb1833ac1435049dc4794
|
|
| MD5 |
762b8ef26699cd9192b63485d5a93b7c
|
|
| BLAKE2b-256 |
88537b2a98d812c8716e743ce08cb4c8923ccc705535d0ceb2457706b51eee90
|
File details
Details for the file onelinemcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: onelinemcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3772015af2c0d1bf6b2ff3655618e49551ca6f330af3d475e6cf39d180ba11c5
|
|
| MD5 |
2b392c3be5abd9a20c46abfb3eb6a9e8
|
|
| BLAKE2b-256 |
27b511299b50d4a833f0624b1304a49c7767b76adac2844057ffda89af049bcc
|