@oneshot-agent/mcp-server 0.1.0
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 +138 -0
- package/bin/oneshot-mcp.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +45 -0
- package/dist/tools/commerce.d.ts +6 -0
- package/dist/tools/commerce.js +82 -0
- package/dist/tools/email.d.ts +4 -0
- package/dist/tools/email.js +48 -0
- package/dist/tools/enrichment.d.ts +8 -0
- package/dist/tools/enrichment.js +86 -0
- package/dist/tools/index.d.ts +16 -0
- package/dist/tools/index.js +57 -0
- package/dist/tools/notifications.d.ts +8 -0
- package/dist/tools/notifications.js +41 -0
- package/dist/tools/research.d.ts +4 -0
- package/dist/tools/research.js +36 -0
- package/dist/tools/sms.d.ts +4 -0
- package/dist/tools/sms.js +24 -0
- package/dist/tools/voice.d.ts +4 -0
- package/dist/tools/voice.js +39 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# @oneshot-agent/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for [OneShot](https://oneshotagent.com) - enabling AI agents to execute commercial actions.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @oneshot-agent/mcp-server
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
### Environment Variables
|
|
14
|
+
|
|
15
|
+
- `ONESHOT_WALLET_PRIVATE_KEY` (required): Your agent's private key for signing payments
|
|
16
|
+
- `ONESHOT_TEST_MODE`: Set to "false" for production (default: "true" - uses testnet)
|
|
17
|
+
|
|
18
|
+
### Claude Desktop
|
|
19
|
+
|
|
20
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"mcpServers": {
|
|
25
|
+
"oneshot": {
|
|
26
|
+
"command": "npx",
|
|
27
|
+
"args": ["-y", "@oneshot-agent/mcp-server"],
|
|
28
|
+
"env": {
|
|
29
|
+
"ONESHOT_WALLET_PRIVATE_KEY": "0xYourPrivateKey"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### OpenClaw
|
|
37
|
+
|
|
38
|
+
Add to your OpenClaw configuration:
|
|
39
|
+
|
|
40
|
+
```yaml
|
|
41
|
+
mcp_servers:
|
|
42
|
+
- name: oneshot
|
|
43
|
+
command: npx -y @oneshot-agent/mcp-server
|
|
44
|
+
env:
|
|
45
|
+
ONESHOT_WALLET_PRIVATE_KEY: "0xYourPrivateKey"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Cursor
|
|
49
|
+
|
|
50
|
+
Add to `.cursor/mcp.json` in your project:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"oneshot": {
|
|
56
|
+
"command": "npx",
|
|
57
|
+
"args": ["-y", "@oneshot-agent/mcp-server"],
|
|
58
|
+
"env": {
|
|
59
|
+
"ONESHOT_WALLET_PRIVATE_KEY": "0xYourPrivateKey"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Available Tools
|
|
67
|
+
|
|
68
|
+
| Tool | Description | Cost |
|
|
69
|
+
|------|-------------|------|
|
|
70
|
+
| `oneshot_email` | Send emails with attachments | ~$0.01 |
|
|
71
|
+
| `oneshot_voice` | AI-powered phone calls | ~$0.25/min |
|
|
72
|
+
| `oneshot_sms` | Send SMS messages | ~$0.035/segment |
|
|
73
|
+
| `oneshot_research` | Deep web research | $0.50-$2.00 |
|
|
74
|
+
| `oneshot_commerce_search` | Search products | Free |
|
|
75
|
+
| `oneshot_commerce_buy` | Purchase products | Product price + fee |
|
|
76
|
+
| `oneshot_enrich_profile` | Enrich person profiles | ~$0.10 |
|
|
77
|
+
| `oneshot_find_email` | Find email addresses | ~$0.10 |
|
|
78
|
+
| `oneshot_verify_email` | Verify email deliverability | ~$0.01 |
|
|
79
|
+
| `oneshot_notifications` | List agent notifications | Free |
|
|
80
|
+
| `oneshot_mark_notification_read` | Mark notification read | Free |
|
|
81
|
+
|
|
82
|
+
## Tool Examples
|
|
83
|
+
|
|
84
|
+
### Send an Email
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
Use the oneshot_email tool to send an email:
|
|
88
|
+
- to: "user@example.com"
|
|
89
|
+
- subject: "Hello from AI"
|
|
90
|
+
- body: "<h1>Hello!</h1><p>This email was sent by an AI agent.</p>"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Make a Phone Call
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
Use the oneshot_voice tool to make a call:
|
|
97
|
+
- target_number: "+14155551234"
|
|
98
|
+
- objective: "Call the restaurant and make a reservation for 2 people at 7pm tonight"
|
|
99
|
+
- caller_persona: "A polite assistant calling on behalf of John"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Send an SMS
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
Use the oneshot_sms tool:
|
|
106
|
+
- to_number: "+14155551234"
|
|
107
|
+
- message: "Your order has shipped! Track it at: https://example.com/track/123"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Research a Topic
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
Use the oneshot_research tool:
|
|
114
|
+
- topic: "What are the latest developments in quantum computing in 2024?"
|
|
115
|
+
- depth: "deep"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Find Someone's Email
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
Use the oneshot_find_email tool:
|
|
122
|
+
- first_name: "John"
|
|
123
|
+
- last_name: "Smith"
|
|
124
|
+
- company_domain: "example.com"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Funding Your Agent
|
|
128
|
+
|
|
129
|
+
Fund your agent wallet at [oneshotagent.com](https://oneshotagent.com) with USDC on Base network.
|
|
130
|
+
|
|
131
|
+
- **Test Mode** (default): Uses Base Sepolia testnet - get test USDC from faucets
|
|
132
|
+
- **Production Mode**: Uses Base Mainnet - requires real USDC
|
|
133
|
+
|
|
134
|
+
## Links
|
|
135
|
+
|
|
136
|
+
- [Documentation](https://docs.oneshotagent.com)
|
|
137
|
+
- [Pricing](https://docs.oneshotagent.com/pricing)
|
|
138
|
+
- [SDK](https://www.npmjs.com/package/@oneshot-agent/sdk)
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
5
|
+
import { OneShot } from "@oneshot-agent/sdk";
|
|
6
|
+
import { tools, handleToolCall } from "./tools/index.js";
|
|
7
|
+
const PRIVATE_KEY = process.env.ONESHOT_WALLET_PRIVATE_KEY;
|
|
8
|
+
const TEST_MODE = process.env.ONESHOT_TEST_MODE !== "false"; // Default to test mode
|
|
9
|
+
if (!PRIVATE_KEY) {
|
|
10
|
+
console.error("Error: ONESHOT_WALLET_PRIVATE_KEY environment variable is required");
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
|
13
|
+
// Initialize OneShot SDK
|
|
14
|
+
const agent = new OneShot({
|
|
15
|
+
privateKey: PRIVATE_KEY,
|
|
16
|
+
testMode: TEST_MODE,
|
|
17
|
+
});
|
|
18
|
+
// Create MCP server
|
|
19
|
+
const server = new Server({
|
|
20
|
+
name: "oneshot-mcp",
|
|
21
|
+
version: "0.1.0",
|
|
22
|
+
}, {
|
|
23
|
+
capabilities: {
|
|
24
|
+
tools: {},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
// List available tools
|
|
28
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
29
|
+
return { tools };
|
|
30
|
+
});
|
|
31
|
+
// Handle tool calls
|
|
32
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
33
|
+
const { name, arguments: args } = request.params;
|
|
34
|
+
return handleToolCall(agent, name, args || {});
|
|
35
|
+
});
|
|
36
|
+
// Start server
|
|
37
|
+
async function main() {
|
|
38
|
+
const transport = new StdioServerTransport();
|
|
39
|
+
await server.connect(transport);
|
|
40
|
+
console.error(`OneShot MCP server running (testMode: ${TEST_MODE})`);
|
|
41
|
+
}
|
|
42
|
+
main().catch((error) => {
|
|
43
|
+
console.error("Server error:", error);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const commerceSearchTool: Tool;
|
|
4
|
+
export declare const commerceBuyTool: Tool;
|
|
5
|
+
export declare function handleCommerceSearch(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").CommerceSearchResult>;
|
|
6
|
+
export declare function handleCommerceBuy(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").CommerceBuyResult>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export const commerceSearchTool = {
|
|
2
|
+
name: "oneshot_commerce_search",
|
|
3
|
+
description: "Search for products to purchase. Free to search, pay only when buying.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
query: {
|
|
8
|
+
type: "string",
|
|
9
|
+
description: "Product search query",
|
|
10
|
+
},
|
|
11
|
+
limit: {
|
|
12
|
+
type: "number",
|
|
13
|
+
description: "Maximum number of results (default: 10)",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
required: ["query"],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const commerceBuyTool = {
|
|
20
|
+
name: "oneshot_commerce_buy",
|
|
21
|
+
description: "Purchase a product. Requires product URL and shipping address. Price + service fee.",
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: {
|
|
25
|
+
product_url: {
|
|
26
|
+
type: "string",
|
|
27
|
+
description: "Product URL to purchase",
|
|
28
|
+
},
|
|
29
|
+
shipping_address: {
|
|
30
|
+
type: "object",
|
|
31
|
+
properties: {
|
|
32
|
+
first_name: { type: "string" },
|
|
33
|
+
last_name: { type: "string" },
|
|
34
|
+
street: { type: "string" },
|
|
35
|
+
street2: { type: "string" },
|
|
36
|
+
city: { type: "string" },
|
|
37
|
+
state: { type: "string" },
|
|
38
|
+
zip_code: { type: "string" },
|
|
39
|
+
country: { type: "string" },
|
|
40
|
+
email: { type: "string" },
|
|
41
|
+
phone: { type: "string" },
|
|
42
|
+
},
|
|
43
|
+
required: ["first_name", "last_name", "street", "city", "state", "zip_code", "phone"],
|
|
44
|
+
},
|
|
45
|
+
quantity: {
|
|
46
|
+
type: "number",
|
|
47
|
+
description: "Quantity to purchase (default: 1)",
|
|
48
|
+
},
|
|
49
|
+
variant_id: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Product variant ID (optional)",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
required: ["product_url", "shipping_address"],
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
export async function handleCommerceSearch(agent, args) {
|
|
58
|
+
return agent.commerceSearch({
|
|
59
|
+
query: args.query,
|
|
60
|
+
limit: args.limit,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export async function handleCommerceBuy(agent, args) {
|
|
64
|
+
const shippingAddress = args.shipping_address;
|
|
65
|
+
return agent.commerceBuy({
|
|
66
|
+
product_url: args.product_url,
|
|
67
|
+
shipping_address: {
|
|
68
|
+
first_name: shippingAddress.first_name,
|
|
69
|
+
last_name: shippingAddress.last_name,
|
|
70
|
+
street: shippingAddress.street,
|
|
71
|
+
street2: shippingAddress.street2,
|
|
72
|
+
city: shippingAddress.city,
|
|
73
|
+
state: shippingAddress.state,
|
|
74
|
+
zip_code: shippingAddress.zip_code,
|
|
75
|
+
country: shippingAddress.country,
|
|
76
|
+
email: shippingAddress.email,
|
|
77
|
+
phone: shippingAddress.phone,
|
|
78
|
+
},
|
|
79
|
+
quantity: args.quantity,
|
|
80
|
+
variant_id: args.variant_id,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const emailTool: Tool;
|
|
4
|
+
export declare function handleEmail(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").EmailResult>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export const emailTool = {
|
|
2
|
+
name: "oneshot_email",
|
|
3
|
+
description: "Send an email. Costs ~$0.01 per email. Supports HTML body and attachments.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
to: {
|
|
8
|
+
type: "string",
|
|
9
|
+
description: "Recipient email address (or comma-separated list)",
|
|
10
|
+
},
|
|
11
|
+
subject: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "Email subject line",
|
|
14
|
+
},
|
|
15
|
+
body: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Email body (plain text or HTML)",
|
|
18
|
+
},
|
|
19
|
+
from_domain: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Custom sender domain (optional, defaults to oneshotagent.com)",
|
|
22
|
+
},
|
|
23
|
+
attachments: {
|
|
24
|
+
type: "array",
|
|
25
|
+
items: {
|
|
26
|
+
type: "object",
|
|
27
|
+
properties: {
|
|
28
|
+
filename: { type: "string" },
|
|
29
|
+
content: { type: "string", description: "Base64 encoded content" },
|
|
30
|
+
url: { type: "string", description: "URL to fetch attachment from" },
|
|
31
|
+
content_type: { type: "string" },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
description: "File attachments (optional)",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
required: ["to", "subject", "body"],
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export async function handleEmail(agent, args) {
|
|
41
|
+
return agent.email({
|
|
42
|
+
to: args.to,
|
|
43
|
+
subject: args.subject,
|
|
44
|
+
body: args.body,
|
|
45
|
+
from_domain: args.from_domain,
|
|
46
|
+
attachments: args.attachments,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const enrichProfileTool: Tool;
|
|
4
|
+
export declare const findEmailTool: Tool;
|
|
5
|
+
export declare const verifyEmailTool: Tool;
|
|
6
|
+
export declare function handleEnrichProfile(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").EnrichProfileResult>;
|
|
7
|
+
export declare function handleFindEmail(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").FindEmailResult>;
|
|
8
|
+
export declare function handleVerifyEmail(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").VerifyEmailResult>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export const enrichProfileTool = {
|
|
2
|
+
name: "oneshot_enrich_profile",
|
|
3
|
+
description: "Enrich a person's profile from LinkedIn URL, email, or name. Returns job title, company, social links, etc. Costs ~$0.10.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
linkedin_url: {
|
|
8
|
+
type: "string",
|
|
9
|
+
description: "LinkedIn profile URL",
|
|
10
|
+
},
|
|
11
|
+
email: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "Email address to enrich",
|
|
14
|
+
},
|
|
15
|
+
name: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Person's full name",
|
|
18
|
+
},
|
|
19
|
+
company_domain: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Company domain for additional context",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export const findEmailTool = {
|
|
27
|
+
name: "oneshot_find_email",
|
|
28
|
+
description: "Find email address for a person at a company. Costs ~$0.10.",
|
|
29
|
+
inputSchema: {
|
|
30
|
+
type: "object",
|
|
31
|
+
properties: {
|
|
32
|
+
full_name: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "Person's full name",
|
|
35
|
+
},
|
|
36
|
+
first_name: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "Person's first name (use with last_name)",
|
|
39
|
+
},
|
|
40
|
+
last_name: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Person's last name (use with first_name)",
|
|
43
|
+
},
|
|
44
|
+
company_domain: {
|
|
45
|
+
type: "string",
|
|
46
|
+
description: "Company domain (e.g., example.com)",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
required: ["company_domain"],
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export const verifyEmailTool = {
|
|
53
|
+
name: "oneshot_verify_email",
|
|
54
|
+
description: "Verify if an email address is valid and deliverable. Costs ~$0.01.",
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: "object",
|
|
57
|
+
properties: {
|
|
58
|
+
email: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description: "Email address to verify",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
required: ["email"],
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
export async function handleEnrichProfile(agent, args) {
|
|
67
|
+
return agent.enrichProfile({
|
|
68
|
+
linkedin_url: args.linkedin_url,
|
|
69
|
+
email: args.email,
|
|
70
|
+
name: args.name,
|
|
71
|
+
company_domain: args.company_domain,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export async function handleFindEmail(agent, args) {
|
|
75
|
+
return agent.findEmail({
|
|
76
|
+
full_name: args.full_name,
|
|
77
|
+
first_name: args.first_name,
|
|
78
|
+
last_name: args.last_name,
|
|
79
|
+
company_domain: args.company_domain,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export async function handleVerifyEmail(agent, args) {
|
|
83
|
+
return agent.verifyEmail({
|
|
84
|
+
email: args.email,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const tools: Tool[];
|
|
4
|
+
export declare function handleToolCall(agent: OneShot, toolName: string, args: Record<string, unknown>): Promise<{
|
|
5
|
+
content: {
|
|
6
|
+
type: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}[];
|
|
9
|
+
isError: boolean;
|
|
10
|
+
} | {
|
|
11
|
+
content: {
|
|
12
|
+
type: string;
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
15
|
+
isError?: undefined;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { emailTool, handleEmail } from "./email.js";
|
|
2
|
+
import { voiceTool, handleVoice } from "./voice.js";
|
|
3
|
+
import { smsTool, handleSms } from "./sms.js";
|
|
4
|
+
import { researchTool, handleResearch } from "./research.js";
|
|
5
|
+
import { commerceSearchTool, commerceBuyTool, handleCommerceSearch, handleCommerceBuy } from "./commerce.js";
|
|
6
|
+
import { enrichProfileTool, findEmailTool, verifyEmailTool, handleEnrichProfile, handleFindEmail, handleVerifyEmail } from "./enrichment.js";
|
|
7
|
+
import { notificationsTool, markReadTool, handleNotifications, handleMarkRead } from "./notifications.js";
|
|
8
|
+
// All available tools
|
|
9
|
+
export const tools = [
|
|
10
|
+
emailTool,
|
|
11
|
+
voiceTool,
|
|
12
|
+
smsTool,
|
|
13
|
+
researchTool,
|
|
14
|
+
commerceSearchTool,
|
|
15
|
+
commerceBuyTool,
|
|
16
|
+
enrichProfileTool,
|
|
17
|
+
findEmailTool,
|
|
18
|
+
verifyEmailTool,
|
|
19
|
+
notificationsTool,
|
|
20
|
+
markReadTool,
|
|
21
|
+
];
|
|
22
|
+
// Tool handlers map
|
|
23
|
+
const handlers = {
|
|
24
|
+
"oneshot_email": handleEmail,
|
|
25
|
+
"oneshot_voice": handleVoice,
|
|
26
|
+
"oneshot_sms": handleSms,
|
|
27
|
+
"oneshot_research": handleResearch,
|
|
28
|
+
"oneshot_commerce_search": handleCommerceSearch,
|
|
29
|
+
"oneshot_commerce_buy": handleCommerceBuy,
|
|
30
|
+
"oneshot_enrich_profile": handleEnrichProfile,
|
|
31
|
+
"oneshot_find_email": handleFindEmail,
|
|
32
|
+
"oneshot_verify_email": handleVerifyEmail,
|
|
33
|
+
"oneshot_notifications": handleNotifications,
|
|
34
|
+
"oneshot_mark_notification_read": handleMarkRead,
|
|
35
|
+
};
|
|
36
|
+
export async function handleToolCall(agent, toolName, args) {
|
|
37
|
+
const handler = handlers[toolName];
|
|
38
|
+
if (!handler) {
|
|
39
|
+
return {
|
|
40
|
+
content: [{ type: "text", text: `Unknown tool: ${toolName}` }],
|
|
41
|
+
isError: true,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
try {
|
|
45
|
+
const result = await handler(agent, args);
|
|
46
|
+
return {
|
|
47
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
52
|
+
return {
|
|
53
|
+
content: [{ type: "text", text: `Error: ${message}` }],
|
|
54
|
+
isError: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const notificationsTool: Tool;
|
|
4
|
+
export declare const markReadTool: Tool;
|
|
5
|
+
export declare function handleNotifications(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").NotificationsResult>;
|
|
6
|
+
export declare function handleMarkRead(agent: OneShot, args: Record<string, unknown>): Promise<{
|
|
7
|
+
success: boolean;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const notificationsTool = {
|
|
2
|
+
name: "oneshot_notifications",
|
|
3
|
+
description: "List notifications for the agent. Free. Shows job completions, failures, and lifecycle warnings.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
unread: {
|
|
8
|
+
type: "boolean",
|
|
9
|
+
description: "Only return unread notifications (default: false)",
|
|
10
|
+
},
|
|
11
|
+
limit: {
|
|
12
|
+
type: "number",
|
|
13
|
+
description: "Maximum notifications to return (default: 50, max: 100)",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export const markReadTool = {
|
|
19
|
+
name: "oneshot_mark_notification_read",
|
|
20
|
+
description: "Mark a notification as read. Free.",
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
notificationId: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Notification UUID to mark as read",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
required: ["notificationId"],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export async function handleNotifications(agent, args) {
|
|
33
|
+
return agent.notifications({
|
|
34
|
+
unread: args.unread,
|
|
35
|
+
limit: args.limit,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export async function handleMarkRead(agent, args) {
|
|
39
|
+
await agent.markNotificationRead(args.notificationId);
|
|
40
|
+
return { success: true };
|
|
41
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const researchTool: Tool;
|
|
4
|
+
export declare function handleResearch(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").ResearchResult>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const researchTool = {
|
|
2
|
+
name: "oneshot_research",
|
|
3
|
+
description: "Perform deep web research on a topic. Returns comprehensive report with sources. Costs $0.50-$2.00 depending on depth.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
topic: {
|
|
8
|
+
type: "string",
|
|
9
|
+
description: "Research topic or question",
|
|
10
|
+
},
|
|
11
|
+
depth: {
|
|
12
|
+
type: "string",
|
|
13
|
+
enum: ["quick", "deep"],
|
|
14
|
+
description: "Research depth (default: deep). Quick: ~30s, Deep: ~2-5min",
|
|
15
|
+
},
|
|
16
|
+
max_sources: {
|
|
17
|
+
type: "number",
|
|
18
|
+
description: "Maximum number of sources to include (optional)",
|
|
19
|
+
},
|
|
20
|
+
output_format: {
|
|
21
|
+
type: "string",
|
|
22
|
+
enum: ["report_markdown", "structured_json"],
|
|
23
|
+
description: "Output format (default: report_markdown)",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
required: ["topic"],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export async function handleResearch(agent, args) {
|
|
30
|
+
return agent.research({
|
|
31
|
+
topic: args.topic,
|
|
32
|
+
depth: args.depth,
|
|
33
|
+
max_sources: args.max_sources,
|
|
34
|
+
output_format: args.output_format,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const smsTool: Tool;
|
|
4
|
+
export declare function handleSms(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").SmsSendResult>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const smsTool = {
|
|
2
|
+
name: "oneshot_sms",
|
|
3
|
+
description: "Send an SMS message. Costs ~$0.035 per segment (160 chars).",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
to_number: {
|
|
8
|
+
type: "string",
|
|
9
|
+
description: "Phone number (E.164 format, e.g., +14155551234)",
|
|
10
|
+
},
|
|
11
|
+
message: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "SMS message content (max 1600 chars, 160 chars per segment)",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
required: ["to_number", "message"],
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export async function handleSms(agent, args) {
|
|
20
|
+
return agent.sms({
|
|
21
|
+
to_number: args.to_number,
|
|
22
|
+
message: args.message,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { OneShot } from "@oneshot-agent/sdk";
|
|
3
|
+
export declare const voiceTool: Tool;
|
|
4
|
+
export declare function handleVoice(agent: OneShot, args: Record<string, unknown>): Promise<import("@oneshot-agent/sdk").VoiceCallResult>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export const voiceTool = {
|
|
2
|
+
name: "oneshot_voice",
|
|
3
|
+
description: "Make an AI-powered phone call. Costs ~$0.25/minute. The AI will follow the provided objective.",
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
target_number: {
|
|
8
|
+
type: "string",
|
|
9
|
+
description: "Phone number to call (E.164 format, e.g., +14155551234)",
|
|
10
|
+
},
|
|
11
|
+
objective: {
|
|
12
|
+
type: "string",
|
|
13
|
+
description: "What the AI should accomplish on the call (min 10 characters)",
|
|
14
|
+
},
|
|
15
|
+
context: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Additional context about the call (optional)",
|
|
18
|
+
},
|
|
19
|
+
caller_persona: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Persona for the AI caller (optional)",
|
|
22
|
+
},
|
|
23
|
+
max_duration_minutes: {
|
|
24
|
+
type: "number",
|
|
25
|
+
description: "Maximum call duration in minutes (1-30, optional)",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
required: ["target_number", "objective"],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export async function handleVoice(agent, args) {
|
|
32
|
+
return agent.voice({
|
|
33
|
+
target_number: args.target_number,
|
|
34
|
+
objective: args.objective,
|
|
35
|
+
context: args.context,
|
|
36
|
+
caller_persona: args.caller_persona,
|
|
37
|
+
max_duration_minutes: args.max_duration_minutes,
|
|
38
|
+
});
|
|
39
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oneshot-agent/mcp-server",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP server for OneShot - commercial actions for AI agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"oneshot-mcp": "./bin/oneshot-mcp.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc",
|
|
13
|
+
"dev": "tsc --watch",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"keywords": ["mcp", "oneshot", "ai-agent", "claude", "tools"],
|
|
17
|
+
"author": "OneShot",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
21
|
+
"@oneshot-agent/sdk": "^0.5.1",
|
|
22
|
+
"zod": "^3.23.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^20.0.0",
|
|
26
|
+
"typescript": "^5.0.0"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
},
|
|
31
|
+
"files": ["dist", "bin", "README.md"]
|
|
32
|
+
}
|