Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,54 @@ import { createRecord, updateRecord } from "@amp-labs/ai/mastra";
const tools = [createRecord, updateRecord];
```

### Testing

The `test` directory contains end-to-end tests for the AI SDK.

#### Running the Simple Test

**Prerequisites:**
- OpenAI API key (required for AI model)
- Ampersand API credentials

1. Configure environment variables in `test/.env`:
Copy link

Copilot AI Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing .env.example file. The README and PR description mention cp .env.example .env but no .env.example file was added to the test directory. This file should be included to help developers set up the required environment variables.

Copilot uses AI. Check for mistakes.
```bash
OPENAI_API_KEY=your_openai_api_key_here
AMPERSAND_API_KEY=your_ampersand_api_key_here
AMPERSAND_PROJECT_ID=your_project_id_here
AMPERSAND_GROUP_REF=your_group_ref_here
```

2. Run the test:
```bash
# From the root directory
pnpm --filter ai-e2e-test test:simple

# Or from the test directory
cd test
pnpm test:simple
```

The simple test demonstrates how to use the `checkConnection` tool with the Vercel AI SDK to verify Salesforce connections.

#### Testing Local Changes

The test uses your **local SDK build** via pnpm workspace linking. To test modifications to the SDK:

1. Make changes to SDK source files in `sdk/lib/`

2. Rebuild the SDK:
```bash
pnpm --filter @amp-labs/ai build
```

3. Re-run the test to verify your changes:
```bash
pnpm --filter ai-e2e-test test:simple
```

The test will use the freshly built SDK from `sdk/dist/`, allowing you to iterate quickly on SDK changes.

## Ampersand MCP Server

Connect your agents to the 150+ connectors we offer at Ampersand via this multi-tenant MCP server. We expose the primitives we offer on the Ampersand platform as native tools here.
Expand Down
147 changes: 147 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
packages:
- 'mcp-server'
- 'sdk'
- 'examples'
- 'examples'
- 'test'
59 changes: 29 additions & 30 deletions sdk/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,49 @@
import { defineConfig } from "vite";
import { VitePluginNode } from "vite-plugin-node";
import dts from "vite-plugin-dts";
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';

export default defineConfig({
define: {
'process.env': {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strips out the the other variables like the API key

AMPERSAND_SENTRY_DSN: process.env.AMPERSAND_SENTRY_DSN, // build time env var
},
'process.env.AMPERSAND_SENTRY_DSN': JSON.stringify(
process.env.AMPERSAND_SENTRY_DSN,
),
},
server: {
port: 3001,
},
build: {
outDir: "./dist",
outDir: './dist',
lib: {
entry: {
mastra: "./lib/adapters/mastra.ts",
mcp: "./lib/adapters/mcp.ts",
aisdk: "./lib/adapters/aisdk.ts",
mastra: './lib/adapters/mastra.ts',
mcp: './lib/adapters/mcp.ts',
aisdk: './lib/adapters/aisdk.ts',
},
formats: ["cjs", "es"],
formats: ['cjs', 'es'],
fileName: (format, entryName) =>
entryName === "index" ? `index.${format}` : `${entryName}/index.${format}`,
entryName === 'index'
? `index.${format}`
: `${entryName}/index.${format}`,
},
rollupOptions: {
external: [
"express",
"dotenv",
"zod",
"trieve-ts-sdk",
"axios",
"dashify",
"mintlify-validation",
"mintlify-openapi-parser",
"ai",
"@mastra/core",
"@amp-labs/sdk-node-platform",
"@amp-labs/sdk-node-write",
"@modelcontextprotocol/sdk",
"@sentry/node",
'express',
'dotenv',
'zod',
'trieve-ts-sdk',
'axios',
'dashify',
'mintlify-validation',
'mintlify-openapi-parser',
'ai',
'@mastra/core',
'@amp-labs/sdk-node-platform',
'@amp-labs/sdk-node-write',
'@modelcontextprotocol/sdk',
'@sentry/node',
],
},
sourcemap: true,
target: "node16",
target: 'node16',
},
plugins: [
dts({ rollupTypes: true }),
],
plugins: [dts({ rollupTypes: true })],
});
Loading
Loading