@gwizai/sdk
v0.0.2
Published
Gwiz SDK and CLI for interacting with Gwiz MCP service
Maintainers
Readme
@gwizai/sdk
A command-line interface for interacting with the Gwiz MCP service.
Installation
Using npx (Recommended)
No installation needed! Just run:
npx @gwizai/sdk --helpGlobal Installation
npm install -g @gwizai/sdkThen use:
gwiz --helpLocal Installation
npm install @gwizai/sdkThen use via npx:
npx gwiz --helpUsage
Authentication
First, authenticate with the MCP service:
npx @gwizai/sdk auth loginThis will open your browser to complete the OAuth flow. The authentication token will be saved to ~/.gwiz/config.json.
To log out:
npx @gwizai/sdk auth logoutListing Tools
View all available MCP tools:
npx @gwizai/sdk tools listTool Commands
Search Emails
Search for emails using vector search:
npx @gwizai/sdk tools search-emails --query "meeting notes" --limit 10With sender filter:
npx @gwizai/sdk tools search-emails --query "invoice" --from "[email protected]"List Contacts
List all contacts:
npx @gwizai/sdk tools list-contactsList Subscriptions
List all email subscriptions:
npx @gwizai/sdk tools list-subscriptionsArchive Emails
Archive one or more emails:
npx @gwizai/sdk tools archive --emailIds "msg1,msg2,msg3"Create Draft
Create a draft email:
npx @gwizai/sdk tools draft --to "[email protected]" --subject "Hello" --body "Message body"Or read body from a file:
npx @gwizai/sdk tools draft --to "[email protected]" --subject "Hello" --file message.txtReply to Email
Reply to an email:
npx @gwizai/sdk tools reply --emailId "msg123" --message "Thanks for your email!"Or read reply from a file:
npx @gwizai/sdk tools reply --emailId "msg123" --file reply.txtUnsubscribe
Unsubscribe from a subscription by email ID:
npx @gwizai/sdk tools unsubscribe --emailId "msg123"Or by domain:
npx @gwizai/sdk tools unsubscribe --domain "example.com"Publishing
To publish a new version to npm:
Update the version in
package.json:npm version patch # for 0.1.0 -> 0.1.1 npm version minor # for 0.1.0 -> 0.2.0 npm version major # for 0.1.0 -> 1.0.0Build the package:
cd apps/sdk bun run buildPublish to npm (make sure you're logged in to npm):
npm publish --access publicNote: Since this is a scoped package (
@gwizai/sdk), you need to use--access publicunless you have a paid npm account.Verify the publication:
npx @gwizai/sdk --help
Prerequisites for Publishing
- npm account: Create an account at npmjs.com
- Login to npm:
npm login - Verify you're logged in:
npm whoami - Ensure you have access to the
@gwizscope:- If the
@gwizorganization doesn't exist, npm will create it when you publish - You may need to create the organization on npmjs.com first
- If the
Vercel AI SDK Integration
The package also exports a module for use with Vercel AI SDK's Agent:
import { gwiz } from "@gwizai/sdk/tools";
import { Agent } from "ai";
// Create tools with explicit configuration
const tools = await gwiz({
url: "https://mcp.gwiz.ai",
token: "your-token-here",
});
// Or use config file (from ~/.gwiz/config.json)
const tools = await gwiz();
// Use with Vercel AI SDK Agent
const agent = new Agent({
// ... other configuration
tools: {
gmail: tools,
},
});The gwiz function returns an object where each key is an MCP tool name (e.g., search-emails, list-contacts, etc.) and each value is a Vercel AI SDK compatible tool.
Available Tools
When you call gwiz(), it dynamically loads all available MCP tools and converts them to Vercel AI SDK format. The tools include:
search-emails- Search for emails using vector searchlist-contacts- List all contactslist-subscriptions- List email subscriptionsarchive- Archive emailsdraft- Create draft emailsreply- Reply to emailsunsubscribe- Unsubscribe from email subscriptions
Development
# Build
bun run build
# Run in development mode
bun run dev
# Type check
bun run typecheck
# Lint
bun run lint