Comprehensive documentation for Gungnir SDK Core, CLI, and MCP Server implementation
# Install Gungnir SDK Core npm install @gungnir/core # Install Gungnir CLI npm install -g gungnir-cli
import { GungnirCore } from '@gungnir/core';
const gungnir = new GungnirCore({ version: '1.0.0' });
gungnir.initialize();
const result = gungnir.process({ data: 'example' });# Configure your Perplexity API key gungnir config set perplexity_api_key your_api_key # Run an MCP task with a prompt gungnir run mcp-task --prompt "Create a weather API server"
The main class for interacting with Gungnir functionality.
Creates a new instance of the GungnirCore class.
| Parameter | Type | Description |
|---|---|---|
| config | GungnirConfig | Configuration object for Gungnir |
Initializes the Gungnir core functionality.
Returns: void
Process data with Gungnir.
| Parameter | Type | Description |
|---|---|---|
| data | any | The data to process |
Returns: Processed data result
Configuration for the Gungnir core.
| Property | Type | Description |
|---|---|---|
| version | string | Version string |
| options | Record<string, any> | Optional configuration options |
Standard result object for Gungnir operations.
| Property | Type | Description |
|---|---|---|
| success | boolean | Whether the operation was successful |
| data | any | Optional result data |
| error | string | Optional error message |
| timestamp | Date | Timestamp of the result |
Manage Gungnir CLI configuration.
gungnir config set <key> <value>
Set a configuration key-value pair.
gungnir config get [key]
Get a configuration value. Shows all if no key is specified.
gungnir config show_path
Shows the path to the configuration file.
Run an MCP server task based on a prompt.
| Option | Description |
|---|---|
| --prompt TEXT | Natural language description of the MCP server to generate |
| --output-dir TEXT | Directory to output the generated files |
| --model TEXT | Model to use for generation |
Interact with Perplexity Sonar API.
| Option | Description |
|---|---|
| --query TEXT | Query to send to Sonar API |
| --model TEXT | Model to use for the Sonar API |
Lists all available models supported by the server.
Generates completions from a chat conversation.
Executes a tool call with the provided parameters.