starguide_client 0.1.2 copy "starguide_client: ^0.1.2" to clipboard
starguide_client: ^0.1.2 copied to clipboard

The client for connecting to Serverpod's Starguide server.

example/example.dart

// A minimal example showing how to use the generated client.
//
// Run with:
//   dart run example/basic_usage.dart

import 'dart:async';
import 'dart:io';

import 'package:starguide_client/starguide_client.dart';

Future<void> main(List<String> args) async {
  // Choose the appropriate host for your environment:
  // - Local dev: 'http://localhost:8080/' (if running the server locally)
  // - Public demo: 'https://starguide.api.serverpod.space/'
  final host = Platform.environment['STARGUIDE_HOST'] ??
      'https://starguide.api.serverpod.space/';

  final client = Client(host);

  // Example: Using the MCP endpoint to fetch resources
  try {
    final resources = await client.mcp.getAllResources();
    print('Fetched ${resources.length} resources via MCP.');
    if (resources.isNotEmpty) {
      final first = resources.first;
      print('First resource: name="${first.name}", uri=${first.uri}');
    }
  } catch (e) {
    stderr.writeln('Failed to fetch MCP resources: $e');
  }
}
0
likes
150
points
85
downloads

Publisher

verified publisherserverpod.dev

Weekly Downloads

The client for connecting to Serverpod's Starguide server.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

serverpod_client

More

Packages that depend on starguide_client