mcpaas 0.1.0 → 1.0.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/LICENSE +1 -1
- package/README.md +112 -78
- package/dist/index.d.ts +191 -0
- package/dist/index.js +83 -209
- package/package.json +17 -46
- package/project.faf +0 -116
- package/src/index.ts +0 -19
- package/src/radio.ts +0 -356
- package/src/types.ts +0 -136
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,127 +1,161 @@
|
|
|
1
1
|
# mcpaas
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/mcpaas)
|
|
4
|
+
[](https://mcpaas.live)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Typed TypeScript client for [MCPaaS](https://mcpaas.live) — the platform for AI context delivery.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Zero dependencies. Works everywhere `fetch` does: Bun, Node 18+, Deno, browsers, edge runtimes.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
## Try It
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
bunx bun -e "import { MCPaaS } from './src'; const m = new MCPaaS(); console.log(await m.getRawSoul('spacex'))"
|
|
14
|
+
```
|
|
10
15
|
|
|
11
16
|
## Install
|
|
12
17
|
|
|
13
18
|
```bash
|
|
19
|
+
bun add mcpaas
|
|
20
|
+
# or
|
|
14
21
|
npm install mcpaas
|
|
15
22
|
```
|
|
16
23
|
|
|
17
24
|
## Quick Start
|
|
18
25
|
|
|
19
26
|
```typescript
|
|
20
|
-
import {
|
|
27
|
+
import { MCPaaS } from 'mcpaas';
|
|
21
28
|
|
|
22
|
-
const
|
|
23
|
-
await radio.connect();
|
|
29
|
+
const m = new MCPaaS();
|
|
24
30
|
|
|
25
|
-
//
|
|
26
|
-
await
|
|
31
|
+
// Read live AI context (a "soul")
|
|
32
|
+
const spacex = await m.getRawSoul('spacex');
|
|
33
|
+
// => "SpaceX — Founded 2002 by Elon Musk..."
|
|
27
34
|
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
// Score any GitHub repo's AI-readiness
|
|
36
|
+
const repo = await m.scoreRepo('anthropics/claude-code');
|
|
37
|
+
// => { score: 72, repo: "anthropics/claude-code", language: "TypeScript", ... }
|
|
38
|
+
|
|
39
|
+
// Check if a namepoint handle is available
|
|
40
|
+
const check = await m.check('myhandle');
|
|
41
|
+
// => { handle: "myhandle", available: true, price: "$2/month" }
|
|
42
|
+
|
|
43
|
+
// Get tag intelligence across 700+ namepoints
|
|
44
|
+
const intel = await m.tagIntel();
|
|
45
|
+
// => { tags: [...], candidates: [...], merges: [...], analysed: 721 }
|
|
32
46
|
```
|
|
33
47
|
|
|
34
|
-
|
|
48
|
+
## What MCPaaS Does
|
|
35
49
|
|
|
36
|
-
|
|
50
|
+
MCPaaS delivers AI context at 300+ Cloudflare edges in sub-millisecond time. The platform provides:
|
|
37
51
|
|
|
38
|
-
|
|
52
|
+
- **Souls** — persistent AI context blocks (project DNA, personas, live data)
|
|
53
|
+
- **Namepoints** — claimed handles in a global directory (like DNS for AI context)
|
|
54
|
+
- **Scoring** — AI-readiness scores for repos and namepoints
|
|
55
|
+
- **Tag Intel** — pattern detection, co-occurrence analysis, and tag suggestions
|
|
56
|
+
- **Globe** — real-time execution stats from 300+ edge locations
|
|
57
|
+
- **Badges** — SVG badges for any GitHub repo's score
|
|
39
58
|
|
|
40
|
-
|
|
41
|
-
Traditional (the tax):
|
|
42
|
-
You → Claude (send 50KB context)
|
|
43
|
-
You → Grok (send 50KB again)
|
|
44
|
-
You → Gemini (send 50KB again)
|
|
45
|
-
= 3x cost, 3x latency, context drift
|
|
46
|
-
|
|
47
|
-
Radio Protocol (the fix):
|
|
48
|
-
You → Broadcast to 91.0 FM (send once)
|
|
49
|
-
Claude ← tuned to 91.0
|
|
50
|
-
Grok ← tuned to 91.0
|
|
51
|
-
Gemini ← tuned to 91.0
|
|
52
|
-
= 1x cost, instant, zero drift
|
|
53
|
-
```
|
|
59
|
+
This SDK wraps all 15 public endpoints into typed methods with full IntelliSense.
|
|
54
60
|
|
|
55
|
-
##
|
|
61
|
+
## API Reference
|
|
56
62
|
|
|
57
|
-
|
|
58
|
-
import { Radio } from 'mcpaas';
|
|
63
|
+
### Souls
|
|
59
64
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
65
|
+
| Method | Returns | Description |
|
|
66
|
+
|--------|---------|-------------|
|
|
67
|
+
| `getSoul(name)` | `Promise<string>` | Structured soul content |
|
|
68
|
+
| `getRawSoul(name)` | `Promise<string>` | Plain text soul content |
|
|
69
|
+
| `listSouls()` | `Promise<SoulStats>` | Total count, top souls, daily operations |
|
|
63
70
|
|
|
64
|
-
|
|
65
|
-
await Promise.all([claude.tune('91.0'), grok.tune('91.0'), gemini.tune('91.0')]);
|
|
71
|
+
### Scoring
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
| Method | Returns | Description |
|
|
74
|
+
|--------|---------|-------------|
|
|
75
|
+
| `score(handle)` | `Promise<ScoreResult>` | Score a namepoint (0-100) |
|
|
76
|
+
| `scoreRepo(repo)` | `Promise<RepoScore>` | Score a GitHub repo's AI-readiness |
|
|
77
|
+
| `leaderboard()` | `Promise<LeaderboardResult>` | Top and recent scored repos |
|
|
78
|
+
|
|
79
|
+
### Directory & Discovery
|
|
80
|
+
|
|
81
|
+
| Method | Returns | Description |
|
|
82
|
+
|--------|---------|-------------|
|
|
83
|
+
| `directory()` | `Promise<DirectoryResult>` | Full namepoint directory with tag index |
|
|
84
|
+
| `check(handle)` | `Promise<CheckResult>` | Handle availability and pricing |
|
|
85
|
+
| `count()` | `Promise<CountResult>` | Claimed/remaining namepoint counts |
|
|
86
|
+
| `discover()` | `Promise<DiscoverResult>` | Discovery feed (namepoints + souls) |
|
|
72
87
|
|
|
73
|
-
|
|
88
|
+
### Tag Intel
|
|
74
89
|
|
|
75
|
-
|
|
90
|
+
| Method | Returns | Description |
|
|
91
|
+
|--------|---------|-------------|
|
|
92
|
+
| `tagIntel()` | `Promise<TagIntelResult>` | Tag patterns, co-occurrence, candidates, merge suggestions |
|
|
93
|
+
| `suggestTags(handle)` | `Promise<SuggestResult>` | Suggested tags for a namepoint based on content |
|
|
94
|
+
|
|
95
|
+
### Badges
|
|
96
|
+
|
|
97
|
+
| Method | Returns | Description |
|
|
98
|
+
|--------|---------|-------------|
|
|
99
|
+
| `badge(owner, repo)` | `string` | SVG badge URL (synchronous) |
|
|
76
100
|
|
|
77
101
|
```typescript
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
maxReconnectAttempts?: number; // Max attempts (default: 5)
|
|
81
|
-
reconnectDelay?: number; // Delay in ms (default: 1000)
|
|
82
|
-
heartbeatInterval?: number; // Ping interval (default: 30000)
|
|
83
|
-
debug?: boolean; // Debug logging (default: false)
|
|
84
|
-
});
|
|
102
|
+
m.badge('Wolfe-Jam', 'faf-cli')
|
|
103
|
+
// => "https://mcpaas.live/badge/Wolfe-Jam/faf-cli.svg"
|
|
85
104
|
```
|
|
86
105
|
|
|
87
|
-
###
|
|
106
|
+
### Globe
|
|
88
107
|
|
|
89
|
-
| Method | Description |
|
|
90
|
-
|
|
91
|
-
| `
|
|
92
|
-
| `tune(frequency)` | Subscribe to a frequency |
|
|
93
|
-
| `untune(frequency)` | Unsubscribe from a frequency |
|
|
94
|
-
| `disconnect()` | Disconnect |
|
|
95
|
-
| `getState()` | `'DISCONNECTED'` \| `'CONNECTING'` \| `'CONNECTED'` \| `'RECONNECTING'` \| `'CLOSED'` |
|
|
96
|
-
| `getTunedFrequencies()` | Set of tuned frequencies |
|
|
108
|
+
| Method | Returns | Description |
|
|
109
|
+
|--------|---------|-------------|
|
|
110
|
+
| `globe()` | `Promise<GlobeResult>` | Edge location execution stats from 300+ Cloudflare colos |
|
|
97
111
|
|
|
98
|
-
###
|
|
112
|
+
### Platform
|
|
99
113
|
|
|
100
|
-
|
|
|
101
|
-
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
| Method | Returns | Description |
|
|
115
|
+
|--------|---------|-------------|
|
|
116
|
+
| `health()` | `Promise<HealthResult>` | Service health + engine status |
|
|
117
|
+
| `info()` | `Promise<InfoResult>` | Server name and version |
|
|
118
|
+
|
|
119
|
+
## Configuration
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
const m = new MCPaaS({
|
|
123
|
+
baseUrl: 'https://mcpaas.live', // default
|
|
124
|
+
});
|
|
125
|
+
```
|
|
108
126
|
|
|
109
|
-
##
|
|
127
|
+
## Error Handling
|
|
110
128
|
|
|
111
|
-
|
|
129
|
+
All methods throw `MCPaaSError` on non-2xx responses:
|
|
112
130
|
|
|
113
|
-
|
|
131
|
+
```typescript
|
|
132
|
+
import { MCPaaS, MCPaaSError } from 'mcpaas';
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
await m.getSoul('nonexistent');
|
|
136
|
+
} catch (e) {
|
|
137
|
+
if (e instanceof MCPaaSError) {
|
|
138
|
+
e.status // 404
|
|
139
|
+
e.body // "Not found"
|
|
140
|
+
e.path // "/souls/nonexistent"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
114
144
|
|
|
115
|
-
|
|
145
|
+
## TypeScript
|
|
116
146
|
|
|
117
|
-
|
|
147
|
+
All response types are exported for use in your own code:
|
|
118
148
|
|
|
119
|
-
|
|
149
|
+
```typescript
|
|
150
|
+
import type { ScoreResult, DirectoryEntry, TagIntelResult } from 'mcpaas';
|
|
151
|
+
```
|
|
120
152
|
|
|
121
153
|
## License
|
|
122
154
|
|
|
123
155
|
MIT
|
|
124
156
|
|
|
125
|
-
|
|
157
|
+
## Links
|
|
126
158
|
|
|
127
|
-
|
|
159
|
+
- [MCPaaS Platform](https://mcpaas.live)
|
|
160
|
+
- [API Dashboard](https://mcpaas.live/souls/stats)
|
|
161
|
+
- [GitHub](https://github.com/Wolfe-Jam/mcpaas-sdk)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCPaaS SDK — Context, on-demand.
|
|
3
|
+
* =================================
|
|
4
|
+
* Zero-dependency TypeScript client for the MCPaaS platform.
|
|
5
|
+
* Works with Bun, Node 18+, Deno, browsers, and edge runtimes.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { MCPaaS } from 'mcpaas';
|
|
9
|
+
* const m = new MCPaaS();
|
|
10
|
+
* const soul = await m.getRawSoul('spacex');
|
|
11
|
+
*/
|
|
12
|
+
export interface MCPaaSOptions {
|
|
13
|
+
/** Base URL of the MCPaaS instance. Default: https://mcpaas.live */
|
|
14
|
+
baseUrl?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SoulStats {
|
|
17
|
+
date: string;
|
|
18
|
+
total_souls: number;
|
|
19
|
+
operations_today: Record<string, number>;
|
|
20
|
+
top_souls: Array<{
|
|
21
|
+
soul: string;
|
|
22
|
+
reads: number;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface ScoreResult {
|
|
26
|
+
handle: string;
|
|
27
|
+
score: number;
|
|
28
|
+
tierReady: boolean;
|
|
29
|
+
valid: boolean;
|
|
30
|
+
engine: string;
|
|
31
|
+
}
|
|
32
|
+
export interface RepoScore {
|
|
33
|
+
score: number;
|
|
34
|
+
repo: string;
|
|
35
|
+
hasFaf: boolean;
|
|
36
|
+
language: string;
|
|
37
|
+
stars: number;
|
|
38
|
+
description: string;
|
|
39
|
+
}
|
|
40
|
+
export interface LeaderboardResult {
|
|
41
|
+
top: Array<{
|
|
42
|
+
repo: string;
|
|
43
|
+
score: number;
|
|
44
|
+
language: string;
|
|
45
|
+
}>;
|
|
46
|
+
recent: Array<{
|
|
47
|
+
repo: string;
|
|
48
|
+
score: number;
|
|
49
|
+
language: string;
|
|
50
|
+
}>;
|
|
51
|
+
total: number;
|
|
52
|
+
}
|
|
53
|
+
export interface DirectoryEntry {
|
|
54
|
+
handle: string;
|
|
55
|
+
name: string;
|
|
56
|
+
tagline: string;
|
|
57
|
+
role: string;
|
|
58
|
+
avatar: number;
|
|
59
|
+
tags: string[];
|
|
60
|
+
userTags: string[];
|
|
61
|
+
score: number;
|
|
62
|
+
}
|
|
63
|
+
export interface DirectoryResult {
|
|
64
|
+
count: number;
|
|
65
|
+
namepoints: DirectoryEntry[];
|
|
66
|
+
userTagIndex: Array<{
|
|
67
|
+
tag: string;
|
|
68
|
+
count: number;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
export interface CheckResult {
|
|
72
|
+
handle: string;
|
|
73
|
+
available: boolean;
|
|
74
|
+
price?: number;
|
|
75
|
+
tier?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface CountResult {
|
|
78
|
+
claimed: number;
|
|
79
|
+
remaining: number;
|
|
80
|
+
tier: string;
|
|
81
|
+
price: string;
|
|
82
|
+
annual: string;
|
|
83
|
+
names: string[];
|
|
84
|
+
}
|
|
85
|
+
export interface DiscoverResult {
|
|
86
|
+
namepoints: DirectoryEntry[];
|
|
87
|
+
souls: string[];
|
|
88
|
+
totalSouls: number;
|
|
89
|
+
}
|
|
90
|
+
export interface TagProfile {
|
|
91
|
+
tag: string;
|
|
92
|
+
count: number;
|
|
93
|
+
cooccurs: Array<{
|
|
94
|
+
tag: string;
|
|
95
|
+
overlap: number;
|
|
96
|
+
}>;
|
|
97
|
+
}
|
|
98
|
+
export interface TagCandidate {
|
|
99
|
+
term: string;
|
|
100
|
+
count: number;
|
|
101
|
+
source: string;
|
|
102
|
+
}
|
|
103
|
+
export interface TagMerge {
|
|
104
|
+
canonical: string;
|
|
105
|
+
variants: string[];
|
|
106
|
+
}
|
|
107
|
+
export interface TagIntelResult {
|
|
108
|
+
tags: TagProfile[];
|
|
109
|
+
candidates: TagCandidate[];
|
|
110
|
+
merges: TagMerge[];
|
|
111
|
+
analysed: number;
|
|
112
|
+
updatedAt: string;
|
|
113
|
+
}
|
|
114
|
+
export interface SuggestResult {
|
|
115
|
+
handle: string;
|
|
116
|
+
existingTags: string[];
|
|
117
|
+
suggestions: string[];
|
|
118
|
+
}
|
|
119
|
+
export interface GlobeLocation {
|
|
120
|
+
code: string;
|
|
121
|
+
count: number;
|
|
122
|
+
lat: number;
|
|
123
|
+
lng: number;
|
|
124
|
+
city: string;
|
|
125
|
+
active: boolean;
|
|
126
|
+
}
|
|
127
|
+
export interface GlobeResult {
|
|
128
|
+
total: number;
|
|
129
|
+
activeLocations: number;
|
|
130
|
+
totalLocations: number;
|
|
131
|
+
locations: GlobeLocation[];
|
|
132
|
+
updated: string;
|
|
133
|
+
}
|
|
134
|
+
export interface HealthResult {
|
|
135
|
+
status: string;
|
|
136
|
+
engine: string;
|
|
137
|
+
engineStatus: string;
|
|
138
|
+
engineScore: number;
|
|
139
|
+
engineSize: string;
|
|
140
|
+
[key: string]: unknown;
|
|
141
|
+
}
|
|
142
|
+
export interface InfoResult {
|
|
143
|
+
name: string;
|
|
144
|
+
version: string;
|
|
145
|
+
[key: string]: unknown;
|
|
146
|
+
}
|
|
147
|
+
export declare class MCPaaS {
|
|
148
|
+
private baseUrl;
|
|
149
|
+
constructor(options?: MCPaaSOptions);
|
|
150
|
+
/** Fetch structured soul content by name */
|
|
151
|
+
getSoul(name: string): Promise<string>;
|
|
152
|
+
/** Fetch raw plain-text soul content */
|
|
153
|
+
getRawSoul(name: string): Promise<string>;
|
|
154
|
+
/** Get soul stats (counts, top souls, operations) */
|
|
155
|
+
listSouls(): Promise<SoulStats>;
|
|
156
|
+
/** Score a namepoint by handle */
|
|
157
|
+
score(handle: string): Promise<ScoreResult>;
|
|
158
|
+
/** Score a GitHub repo (owner/repo or full URL) */
|
|
159
|
+
scoreRepo(repo: string): Promise<RepoScore>;
|
|
160
|
+
/** Get the scoring leaderboard */
|
|
161
|
+
leaderboard(): Promise<LeaderboardResult>;
|
|
162
|
+
/** Get the full namepoint directory */
|
|
163
|
+
directory(): Promise<DirectoryResult>;
|
|
164
|
+
/** Check if a handle is available */
|
|
165
|
+
check(handle: string): Promise<CheckResult>;
|
|
166
|
+
/** Get namepoint counts */
|
|
167
|
+
count(): Promise<CountResult>;
|
|
168
|
+
/** Discovery feed (namepoints + souls) */
|
|
169
|
+
discover(): Promise<DiscoverResult>;
|
|
170
|
+
/** Full tag intelligence: patterns, co-occurrence, candidates, merges */
|
|
171
|
+
tagIntel(): Promise<TagIntelResult>;
|
|
172
|
+
/** Suggest tags for a namepoint based on content patterns */
|
|
173
|
+
suggestTags(handle: string): Promise<SuggestResult>;
|
|
174
|
+
/** Get the badge URL for a GitHub repo (synchronous — returns URL string) */
|
|
175
|
+
badge(owner: string, repo: string): string;
|
|
176
|
+
/** Get edge location execution stats from 300+ Cloudflare colos */
|
|
177
|
+
globe(): Promise<GlobeResult>;
|
|
178
|
+
/** Health check */
|
|
179
|
+
health(): Promise<HealthResult>;
|
|
180
|
+
/** Server info */
|
|
181
|
+
info(): Promise<InfoResult>;
|
|
182
|
+
private json;
|
|
183
|
+
private text;
|
|
184
|
+
}
|
|
185
|
+
export declare class MCPaaSError extends Error {
|
|
186
|
+
status: number;
|
|
187
|
+
body: string;
|
|
188
|
+
path: string;
|
|
189
|
+
constructor(status: number, body: string, path: string);
|
|
190
|
+
}
|
|
191
|
+
export default MCPaaS;
|