Download the PHP package dg/google-services without Composer

On this page you can find all versions of the php package dg/google-services. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package google-services

dg/google-services

Ergonomic PHP wrappers over the official google/apiclient for Gmail, Calendar, Meet and Google Slides, plus a single-user MCP server (stdio) that exposes those operations as tools to Claude and other MCP clients.

Requires PHP 8.2–8.5. See CLAUDE.md for the detailed architecture notes.

Installation

OAuth setup (one-time)

  1. In the Google Cloud Console create an OAuth 2.0 Client (type "Web application").
  2. Add an authorized redirect URI pointing at demo/oauth2callback.php (e.g. http://localhost/oauth2callback.php).
  3. Download the client credentials and save them as demo/tokens/secret.json.
  4. Run the authorization flow and grant the requested scopes:

    This writes demo/tokens/token.json. Tokens auto-refresh from then on. Re-run this whenever the required scope list changes — tool calls against a token that is missing a scope fail with a clear message.

Upgrading an existing install: the server now requests the full Calendar scope (for calendar_create_event) instead of read-only. An existing token.json granted only calendar.readonly no longer covers the required scopes, so every tool call (Gmail and Slides included, since authentication is shared) will fail with a clear "missing required scope" error until you re-run php demo/authenticate.php.

Running the MCP server

Configuration is via environment variables (an MCP host passes them through its config; see demo/.mcp.json.example for an example):

Variable Purpose
GOOGLE_TOKEN_DIR OAuth token directory (default ./demo/tokens)
GOOGLE_TOOLS Which tools the server exposes (default gmail, calendar:read, slides), see below
GOOGLE_FILES_DIR Attachment sandbox directory (required for attachment download/upload)

Choosing tools: GOOGLE_TOOLS

Every tool has an access level, and each level includes the lower ones:

GOOGLE_TOOLS is a comma-separated list of rules applied left to right, starting from nothing:

Rule Meaning
slides whole service up to write
gmail:read service up to the given level (read, write, send)
gmail_create_draft a single tool
gmail_label_* tools matching the pattern (never a send-level one)
default the default selection gmail, calendar:read, slides (cannot be negated)
-rule removes tools instead (a service is removed as -gmail, without a level)

Nothing reaches third parties unless you name it: send-level tools are enabled only by service:send or by their full name.

Disabled tools are not advertised to the model at all. An invalid rule (unknown service, level or tool, a pattern matching nothing) stops the server with a message on stderr, and on startup the server logs what it enabled, e.g. tools: calendar off, gmail off, slides 12/12 tools.

The server requests OAuth scopes only for the enabled services. To get a token limited to them (e.g. a Slides-only token that cannot touch the mailbox), run the authorization flow with the same GOOGLE_TOOLS and a separate GOOGLE_TOKEN_DIR containing a copy of secret.json.

The server is single-user by design: tokens live on the local filesystem and are not suitable for a shared or multi-user deployment without rewriting the auth layer.

Development

Security notes


All versions of google-services with dependencies

PHP Build Version
Package Version
Requires php Version 8.2 - 8.5
google/apiclient Version ^2.18
mcp/sdk Version ^0.7.0
symfony/finder Version ^7.0 || ^8.0
nette/mail Version ^4.1
nette/utils Version ^4.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dg/google-services contains the following files

Loading the files please wait ...