mcpaas 1.0.0 → 1.0.2
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 +135 -54
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,115 +1,196 @@
|
|
|
1
1
|
# mcpaas
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/mcpaas)
|
|
4
|
+
[](https://bun.sh)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
**AI context has an API. This is the client.**
|
|
8
|
+
|
|
9
|
+
Every soul, score, namepoint, tag, and edge location on [MCPaaS](https://mcpaas.live) — typed, zero-dep, one import.
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import { MCPaaS } from 'mcpaas';
|
|
13
|
+
const mcpaas = new MCPaaS();
|
|
14
|
+
|
|
15
|
+
const soul = await mcpaas.getRawSoul('spacex');
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
That's a live API call. Run it. You'll get SpaceX context back in ~50ms from the nearest Cloudflare edge.
|
|
19
|
+
|
|
20
|
+
---
|
|
6
21
|
|
|
7
22
|
## Install
|
|
8
23
|
|
|
9
24
|
```bash
|
|
10
|
-
|
|
11
|
-
#
|
|
12
|
-
bun add mcpaas
|
|
25
|
+
bun add mcpaas # Bun-native
|
|
26
|
+
npm install mcpaas # Also works with Node 18+, Deno, browsers, edge runtimes
|
|
13
27
|
```
|
|
14
28
|
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## What MCPaaS Does
|
|
32
|
+
|
|
33
|
+
MCPaaS is a context delivery platform running on 300+ Cloudflare edges.
|
|
34
|
+
|
|
35
|
+
| Concept | What it is |
|
|
36
|
+
|---------|-----------|
|
|
37
|
+
| **Soul** | A block of AI context — project DNA, persona, live data |
|
|
38
|
+
| **Namepoint** | A claimed handle in a global directory (like DNS for context) |
|
|
39
|
+
| **Score** | AI-readiness rating for a repo or namepoint (0-100) |
|
|
40
|
+
| **Tag Intel** | Pattern detection and co-occurrence analysis across all namepoints |
|
|
41
|
+
| **Globe** | Real-time execution stats from every edge location |
|
|
42
|
+
| **Badge** | SVG score badge for any GitHub repo |
|
|
43
|
+
|
|
44
|
+
This SDK wraps the public HTTP API into typed methods with full IntelliSense.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
15
48
|
## Quick Start
|
|
16
49
|
|
|
17
50
|
```typescript
|
|
18
51
|
import { MCPaaS } from 'mcpaas';
|
|
19
52
|
|
|
20
|
-
const
|
|
53
|
+
const mcpaas = new MCPaaS();
|
|
21
54
|
|
|
22
|
-
// Read
|
|
23
|
-
const soul = await
|
|
24
|
-
console.log(soul);
|
|
55
|
+
// Read live AI context
|
|
56
|
+
const soul = await mcpaas.getRawSoul('spacex');
|
|
25
57
|
|
|
26
|
-
// Score a
|
|
27
|
-
const
|
|
28
|
-
console.log(
|
|
58
|
+
// Score a GitHub repo's AI-readiness
|
|
59
|
+
const repo = await mcpaas.scoreRepo('anthropics/claude-code');
|
|
60
|
+
console.log(repo.score, repo.language);
|
|
29
61
|
|
|
30
|
-
// Check handle
|
|
31
|
-
const check = await
|
|
62
|
+
// Check if a namepoint handle is available
|
|
63
|
+
const check = await mcpaas.check('myhandle');
|
|
32
64
|
console.log(check.available);
|
|
65
|
+
|
|
66
|
+
// Tag intelligence across the entire directory
|
|
67
|
+
const intel = await mcpaas.tagIntel();
|
|
68
|
+
console.log(intel.tags.length, 'tag profiles');
|
|
33
69
|
```
|
|
34
70
|
|
|
35
|
-
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## API Reference
|
|
36
74
|
|
|
37
75
|
### Souls
|
|
38
76
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
77
|
+
| Method | Returns | Description |
|
|
78
|
+
|--------|---------|-------------|
|
|
79
|
+
| `getSoul(name)` | `Promise<string>` | Structured soul content |
|
|
80
|
+
| `getRawSoul(name)` | `Promise<string>` | Plain text soul content |
|
|
81
|
+
| `listSouls()` | `Promise<SoulStats>` | Total count, top souls, daily operations |
|
|
44
82
|
|
|
45
83
|
### Scoring
|
|
46
84
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
85
|
+
| Method | Returns | Description |
|
|
86
|
+
|--------|---------|-------------|
|
|
87
|
+
| `score(handle)` | `Promise<ScoreResult>` | Score a namepoint (0-100) |
|
|
88
|
+
| `scoreRepo(repo)` | `Promise<RepoScore>` | Score a GitHub repo's AI-readiness |
|
|
89
|
+
| `leaderboard()` | `Promise<LeaderboardResult>` | Top and recent scored repos |
|
|
52
90
|
|
|
53
91
|
### Directory & Discovery
|
|
54
92
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
93
|
+
| Method | Returns | Description |
|
|
94
|
+
|--------|---------|-------------|
|
|
95
|
+
| `directory()` | `Promise<DirectoryResult>` | Full namepoint directory with tag index |
|
|
96
|
+
| `check(handle)` | `Promise<CheckResult>` | Handle availability and pricing |
|
|
97
|
+
| `count()` | `Promise<CountResult>` | Claimed/remaining namepoint counts |
|
|
98
|
+
| `discover()` | `Promise<DiscoverResult>` | Discovery feed (namepoints + souls) |
|
|
61
99
|
|
|
62
100
|
### Tag Intel
|
|
63
101
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
102
|
+
| Method | Returns | Description |
|
|
103
|
+
|--------|---------|-------------|
|
|
104
|
+
| `tagIntel()` | `Promise<TagIntelResult>` | Tag patterns, co-occurrence, candidates, merge suggestions |
|
|
105
|
+
| `suggestTags(handle)` | `Promise<SuggestResult>` | Suggested tags for a namepoint based on content |
|
|
68
106
|
|
|
69
107
|
### Badges
|
|
70
108
|
|
|
109
|
+
| Method | Returns | Description |
|
|
110
|
+
|--------|---------|-------------|
|
|
111
|
+
| `badge(owner, repo)` | `string` | SVG badge URL (synchronous) |
|
|
112
|
+
|
|
71
113
|
```typescript
|
|
72
|
-
|
|
73
|
-
// => https://mcpaas.live/badge/
|
|
114
|
+
mcpaas.badge('Wolfe-Jam', 'faf-cli')
|
|
115
|
+
// => "https://mcpaas.live/badge/Wolfe-Jam/faf-cli.svg"
|
|
74
116
|
```
|
|
75
117
|
|
|
76
118
|
### Globe
|
|
77
119
|
|
|
120
|
+
| Method | Returns | Description |
|
|
121
|
+
|--------|---------|-------------|
|
|
122
|
+
| `globe()` | `Promise<GlobeResult>` | Edge location stats from 300+ Cloudflare colos |
|
|
123
|
+
|
|
124
|
+
### Platform
|
|
125
|
+
|
|
126
|
+
| Method | Returns | Description |
|
|
127
|
+
|--------|---------|-------------|
|
|
128
|
+
| `health()` | `Promise<HealthResult>` | Service health + engine status |
|
|
129
|
+
| `info()` | `Promise<InfoResult>` | Server name and version |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Error Handling
|
|
134
|
+
|
|
135
|
+
All methods throw `MCPaaSError` on non-2xx responses:
|
|
136
|
+
|
|
78
137
|
```typescript
|
|
79
|
-
|
|
138
|
+
import { MCPaaS, MCPaaSError } from 'mcpaas';
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
await mcpaas.getSoul('nonexistent');
|
|
142
|
+
} catch (e) {
|
|
143
|
+
if (e instanceof MCPaaSError) {
|
|
144
|
+
e.status // 404
|
|
145
|
+
e.body // "Not found"
|
|
146
|
+
e.path // "/souls/nonexistent"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
80
149
|
```
|
|
81
150
|
|
|
82
|
-
|
|
151
|
+
## Exported Types
|
|
152
|
+
|
|
153
|
+
All response types are exported:
|
|
83
154
|
|
|
84
155
|
```typescript
|
|
85
|
-
|
|
86
|
-
m.info() // Server info
|
|
156
|
+
import type { ScoreResult, DirectoryEntry, TagIntelResult } from 'mcpaas';
|
|
87
157
|
```
|
|
88
158
|
|
|
89
159
|
## Configuration
|
|
90
160
|
|
|
91
161
|
```typescript
|
|
92
|
-
const
|
|
162
|
+
const mcpaas = new MCPaaS({
|
|
93
163
|
baseUrl: 'https://mcpaas.live', // default
|
|
94
164
|
});
|
|
95
165
|
```
|
|
96
166
|
|
|
97
|
-
|
|
167
|
+
---
|
|
98
168
|
|
|
99
|
-
|
|
100
|
-
|
|
169
|
+
## Internals
|
|
170
|
+
|
|
171
|
+
Single file. 250 lines. Zero dependencies. Native `fetch` only.
|
|
101
172
|
|
|
102
|
-
try {
|
|
103
|
-
await m.getSoul('nonexistent');
|
|
104
|
-
} catch (e) {
|
|
105
|
-
if (e instanceof MCPaaSError) {
|
|
106
|
-
console.log(e.status); // HTTP status code
|
|
107
|
-
console.log(e.body); // Response body
|
|
108
|
-
console.log(e.path); // Request path
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
173
|
```
|
|
174
|
+
src/index.ts ← Types + MCPaaS class + MCPaaSError (that's it)
|
|
175
|
+
tests/sdk.test.ts ← 19 tests against live mcpaas.live
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Built with Bun. Tested with Bun. Works anywhere `fetch` does.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Why Bun?
|
|
183
|
+
|
|
184
|
+
Bun powers Claude Code. This SDK follows the same toolchain — `bun build`, `bun test`, TypeScript-native. No transpiler config, no bundler plugins, no runtime dependencies.
|
|
185
|
+
|
|
186
|
+
Node, Deno, browsers, and edge runtimes work too. But Bun is home.
|
|
187
|
+
|
|
188
|
+
---
|
|
112
189
|
|
|
113
190
|
## License
|
|
114
191
|
|
|
115
192
|
MIT
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
Built by [Wolfe James](https://github.com/Wolfe-Jam) | Powered by [MCPaaS](https://mcpaas.live) | Format: [FAF](https://faf.one)
|
package/dist/index.js
CHANGED