hyperterse 2.1.0 → 2.2.1
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.
- package/README.md +183 -71
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- Start of - Dont change this block -->
|
|
1
2
|
<div align="center">
|
|
2
3
|
<picture>
|
|
3
4
|
<img alt="Hyperterse - connect your data to your agents." src="docs/assets/og.png" />
|
|
@@ -22,21 +23,28 @@
|
|
|
22
23
|
|
|
23
24
|
---
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
<!-- End of - Dont change this block -->
|
|
26
27
|
|
|
27
|
-
-
|
|
28
|
-
- pluggable adapters (Postgres, MySQL, MongoDB, Redis),
|
|
29
|
-
- optional scripts for transforms and handlers,
|
|
30
|
-
- MCP runtime exposure over Streamable HTTP.
|
|
28
|
+
Hyperterse is a **tool-first MCP framework** for building AI-ready backend surfaces from declarative config.
|
|
31
29
|
|
|
32
|
-
|
|
30
|
+
You define tools and adapters in the filesystem, and Hyperterse handles compile-time validation, script bundling, runtime execution, auth, caching, and observability.
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
- **Declarative runtime**: root config + adapter files + tool files.
|
|
36
|
-
- **Extensible execution pipeline**: auth -> input transform -> execute -> output transform.
|
|
37
|
-
- **Embedded scripting**: script hooks run in a sandboxed runtime; bundled at compile time.
|
|
32
|
+
## What Hyperterse is for
|
|
38
33
|
|
|
39
|
-
|
|
34
|
+
- Exposing database queries and custom logic as MCP tools
|
|
35
|
+
- Running a production MCP server over Streamable HTTP
|
|
36
|
+
- Keeping tool definitions declarative while still supporting TypeScript handlers/transforms
|
|
37
|
+
|
|
38
|
+
## Core capabilities
|
|
39
|
+
|
|
40
|
+
- **Filesystem discovery**: each `app/tools/*/config.terse` becomes one project tool.
|
|
41
|
+
- **Execution models**: DB-backed tools (`use` + `statement`) or script-backed tools (`handler`).
|
|
42
|
+
- **Database adapters**: PostgreSQL, MySQL, MongoDB, Redis.
|
|
43
|
+
- **Per-tool auth**: built-in `allow_all` and `api_key`, plus custom plugins.
|
|
44
|
+
- **In-memory caching**: global defaults + per-tool overrides.
|
|
45
|
+
- **Observability**: OpenTelemetry tracing/metrics + structured logging.
|
|
46
|
+
|
|
47
|
+
## Quick Start
|
|
40
48
|
|
|
41
49
|
### Install
|
|
42
50
|
|
|
@@ -50,66 +58,153 @@ curl -fsSL https://hyperterse.com/install | bash
|
|
|
50
58
|
hyperterse init
|
|
51
59
|
```
|
|
52
60
|
|
|
53
|
-
|
|
61
|
+
Generated starter structure:
|
|
54
62
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
```text
|
|
64
|
+
.
|
|
65
|
+
├── .hyperterse
|
|
66
|
+
├── .agent/
|
|
67
|
+
│ └── skills/
|
|
68
|
+
│ └── hyperterse-docs/
|
|
69
|
+
│ └── SKILL.md
|
|
70
|
+
└── app/
|
|
71
|
+
└── tools/
|
|
72
|
+
└── hello-world/
|
|
73
|
+
├── config.terse
|
|
74
|
+
└── handler.ts
|
|
75
|
+
```
|
|
59
76
|
|
|
60
|
-
###
|
|
77
|
+
### Start
|
|
61
78
|
|
|
62
79
|
```bash
|
|
63
80
|
hyperterse start
|
|
64
81
|
```
|
|
65
82
|
|
|
66
|
-
With
|
|
83
|
+
With live reload:
|
|
67
84
|
|
|
68
85
|
```bash
|
|
69
86
|
hyperterse start --watch
|
|
70
87
|
```
|
|
71
88
|
|
|
72
|
-
###
|
|
89
|
+
### Verify health
|
|
73
90
|
|
|
74
91
|
```bash
|
|
75
92
|
curl http://localhost:8080/heartbeat
|
|
76
93
|
```
|
|
77
94
|
|
|
95
|
+
Expected response:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{ "success": true }
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 5) List MCP entry tools
|
|
102
|
+
|
|
78
103
|
```bash
|
|
79
|
-
curl -X POST http://localhost:8080/mcp \
|
|
104
|
+
curl -s -X POST http://localhost:8080/mcp \
|
|
80
105
|
-H "Content-Type: application/json" \
|
|
81
106
|
-d '{
|
|
82
107
|
"jsonrpc": "2.0",
|
|
83
108
|
"method": "tools/list",
|
|
84
109
|
"id": 1
|
|
85
|
-
}'
|
|
110
|
+
}' | jq
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
By design, Hyperterse exposes two transport-layer tools:
|
|
114
|
+
|
|
115
|
+
- `search` - discover project tools by natural language
|
|
116
|
+
- `execute` - execute a project tool by name
|
|
117
|
+
|
|
118
|
+
### 6) Discover project tools
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
curl -s -X POST http://localhost:8080/mcp \
|
|
122
|
+
-H "Content-Type: application/json" \
|
|
123
|
+
-d '{
|
|
124
|
+
"jsonrpc": "2.0",
|
|
125
|
+
"method": "tools/call",
|
|
126
|
+
"params": {
|
|
127
|
+
"name": "search",
|
|
128
|
+
"arguments": {
|
|
129
|
+
"query": "hello world greeting"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"id": 2
|
|
133
|
+
}' | jq
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Search hits include `name`, `description`, `relevance_score`, and `inputs`.
|
|
137
|
+
|
|
138
|
+
### Execute a project tool
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
curl -s -X POST http://localhost:8080/mcp \
|
|
142
|
+
-H "Content-Type: application/json" \
|
|
143
|
+
-d '{
|
|
144
|
+
"jsonrpc": "2.0",
|
|
145
|
+
"method": "tools/call",
|
|
146
|
+
"params": {
|
|
147
|
+
"name": "execute",
|
|
148
|
+
"arguments": {
|
|
149
|
+
"tool": "hello-world",
|
|
150
|
+
"inputs": { "name": "Hyperterse" }
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"id": 3
|
|
154
|
+
}' | jq
|
|
86
155
|
```
|
|
87
156
|
|
|
88
|
-
|
|
157
|
+
### Validate and build
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
hyperterse validate
|
|
161
|
+
hyperterse build -o dist
|
|
162
|
+
hyperterse serve dist/
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Configuration model
|
|
166
|
+
|
|
167
|
+
### Project layout
|
|
89
168
|
|
|
90
169
|
```text
|
|
91
170
|
my-project/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
171
|
+
├── .hyperterse
|
|
172
|
+
├── app/
|
|
173
|
+
│ ├── adapters/
|
|
174
|
+
│ │ └── primary-db.terse
|
|
175
|
+
│ └── tools/
|
|
176
|
+
│ ├── get-user/
|
|
177
|
+
│ │ ├── config.terse
|
|
178
|
+
│ │ ├── input.ts
|
|
179
|
+
│ │ └── output.ts
|
|
180
|
+
│ └── get-weather/
|
|
181
|
+
│ ├── config.terse
|
|
182
|
+
│ └── handler.ts
|
|
183
|
+
└── package.json
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Root config (`.hyperterse`)
|
|
187
|
+
|
|
188
|
+
```yaml
|
|
189
|
+
name: my-service
|
|
190
|
+
server:
|
|
191
|
+
port: 8080
|
|
192
|
+
log_level: 3
|
|
193
|
+
tools:
|
|
194
|
+
search:
|
|
195
|
+
limit: 10
|
|
196
|
+
cache:
|
|
197
|
+
enabled: true
|
|
198
|
+
ttl: 60
|
|
104
199
|
```
|
|
105
200
|
|
|
106
|
-
## Tool
|
|
201
|
+
## Tool Examples
|
|
107
202
|
|
|
108
203
|
### DB-backed tool
|
|
109
204
|
|
|
110
205
|
```yaml
|
|
111
|
-
description: "Get user by
|
|
112
|
-
use:
|
|
206
|
+
description: "Get user by ID"
|
|
207
|
+
use: primary-db
|
|
113
208
|
statement: |
|
|
114
209
|
SELECT id, name, email
|
|
115
210
|
FROM users
|
|
@@ -117,60 +212,77 @@ statement: |
|
|
|
117
212
|
inputs:
|
|
118
213
|
user_id:
|
|
119
214
|
type: int
|
|
215
|
+
auth:
|
|
216
|
+
plugin: api_key
|
|
217
|
+
policy:
|
|
218
|
+
value: "{{ env.API_KEY }}"
|
|
120
219
|
```
|
|
121
220
|
|
|
122
221
|
### Script-backed tool
|
|
123
222
|
|
|
124
223
|
```yaml
|
|
125
|
-
description: "Get weather"
|
|
126
|
-
handler: "./
|
|
224
|
+
description: "Get weather by city"
|
|
225
|
+
handler: "./handler.ts"
|
|
226
|
+
inputs:
|
|
227
|
+
city:
|
|
228
|
+
type: string
|
|
229
|
+
auth:
|
|
230
|
+
plugin: allow_all
|
|
127
231
|
```
|
|
128
232
|
|
|
129
|
-
|
|
233
|
+
Supported input types:
|
|
130
234
|
|
|
131
|
-
- `
|
|
132
|
-
- `
|
|
133
|
-
- `
|
|
134
|
-
- `
|
|
135
|
-
- `
|
|
136
|
-
- `upgrade` - upgrade installed binary
|
|
137
|
-
- `completion` - shell completion helper
|
|
235
|
+
- `string`
|
|
236
|
+
- `int`
|
|
237
|
+
- `float`
|
|
238
|
+
- `boolean`
|
|
239
|
+
- `datetime`
|
|
138
240
|
|
|
139
|
-
|
|
241
|
+
Each tool must define exactly one execution mode:
|
|
140
242
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
hyperterse build -o dist
|
|
144
|
-
hyperterse serve dist/
|
|
145
|
-
```
|
|
243
|
+
- `use` (adapter-backed), or
|
|
244
|
+
- `handler` (script-backed)
|
|
146
245
|
|
|
147
|
-
|
|
246
|
+
## Runtime model
|
|
148
247
|
|
|
149
|
-
|
|
248
|
+
All tool interaction happens through MCP Streamable HTTP at `/mcp` (JSON-RPC 2.0).
|
|
150
249
|
|
|
151
|
-
|
|
152
|
-
- adapter files: `app/adapters/*.terse`
|
|
153
|
-
- tool files: `app/tools/*/config.terse`
|
|
250
|
+
Execution pipeline:
|
|
154
251
|
|
|
155
|
-
|
|
252
|
+
1. Tool resolution
|
|
253
|
+
2. Authentication
|
|
254
|
+
3. Input transform (optional)
|
|
255
|
+
4. Execution (DB or handler)
|
|
256
|
+
5. Output transform (optional)
|
|
257
|
+
6. Response serialization
|
|
156
258
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
- `
|
|
160
|
-
- `
|
|
161
|
-
-
|
|
259
|
+
## Security notes
|
|
260
|
+
|
|
261
|
+
- Use `{{ env.VAR_NAME }}` for secrets and connection strings.
|
|
262
|
+
- `{{ inputs.field }}` statement substitution is textual; enforce strict input schemas and safe query patterns.
|
|
263
|
+
- Configure tool-level auth explicitly for production use.
|
|
162
264
|
|
|
163
|
-
##
|
|
265
|
+
## Documentation map
|
|
164
266
|
|
|
165
|
-
|
|
267
|
+
- [Documentation index (`llms.txt`)](https://docs.hyperterse.com/llms.txt)
|
|
268
|
+
- [Introduction](https://docs.hyperterse.com/introduction)
|
|
269
|
+
- [Quickstart](https://docs.hyperterse.com/quickstart)
|
|
270
|
+
- [Project structure](https://docs.hyperterse.com/concepts/project-structure)
|
|
271
|
+
- [Tools](https://docs.hyperterse.com/concepts/tools)
|
|
272
|
+
- [Adapters](https://docs.hyperterse.com/concepts/adapters)
|
|
273
|
+
- [Scripts](https://docs.hyperterse.com/concepts/scripts)
|
|
274
|
+
- [MCP transport](https://docs.hyperterse.com/runtime/mcp-transport)
|
|
275
|
+
- [Execution pipeline](https://docs.hyperterse.com/runtime/execution-pipeline)
|
|
276
|
+
- [CLI reference](https://docs.hyperterse.com/reference/cli)
|
|
277
|
+
- [Configuration schemas](https://docs.hyperterse.com/reference/configuration-schemas)
|
|
166
278
|
|
|
167
279
|
## Contributing
|
|
168
280
|
|
|
169
|
-
1. Fork the repo
|
|
170
|
-
2. Create a feature branch
|
|
171
|
-
3. Add or update tests
|
|
172
|
-
4. Run validation
|
|
173
|
-
5. Open a PR
|
|
281
|
+
1. Fork the repo.
|
|
282
|
+
2. Create a feature branch.
|
|
283
|
+
3. Add or update tests.
|
|
284
|
+
4. Run validation locally.
|
|
285
|
+
5. Open a PR.
|
|
174
286
|
|
|
175
287
|
See `CONTRIBUTING.md` and `CODE_OF_CONDUCT.md`.
|
|
176
288
|
|