### Install from source Source: https://github.com/hstern/activesync-mcp/blob/main/README.md Build the activesync-mcp binary from source using go install. ```sh go install github.com/hstern/activesync-mcp/cmd/activesync-mcp@latest ``` -------------------------------- ### Configuration Reference Source: https://github.com/hstern/activesync-mcp/blob/main/README.md Example TOML configuration for activesync-mcp, including account settings, secret sources, and access controls. ```toml state_dir = "~/.local/state/activesync-mcp" # bbolt state DB lives here log_level = "info" # debug | info | warn | error [[account]] name = "work" server_url = "https://…/Microsoft-Server-ActiveSync" username = "henry@stern.ca" device_type = "MCP" # default; override per server policy as_version = "14.1" # default user_agent = "activesync-mcp/0.1" # default allow_insecure = false # skip TLS verify; off by default # Pick exactly one secret source: secret = { keyring_service = "activesync-mcp", keyring_account = "work" } # secret = { command = ["pass", "show", "mail/work"] } # secret = { command = ["op", "read", "op://Personal/work/password"] } default_access = "ro" # ro | rw, default ro [account.access] calendar = "rw" tasks = "rw" # email, contacts, notes inherit default_access (= ro here) # Optional: per-account auth scheme overrides. # auth = "basic" # default # auth = "bearer" # OAuth — use bearer_command callback to refresh tokens # auth = "ntlm" # legacy on-prem Exchange # auth = "negotiate" # SPNEGO/Kerberos # tls_client_cert = { ... } # mTLS ``` -------------------------------- ### Binary-spawn pattern Source: https://github.com/hstern/activesync-mcp/blob/main/AGENTS.md Example of the binary-spawn pattern used in tier 3 and tier 4 tests. ```go bin := buildBinary(t) // go build -o tmp/x ./cmd/activesync-mcp cmd := exec.Command(bin, "serve", "--config", "testdata/...") // hand pipes to the SDK's stdio transport, then mcp.NewClient as above ``` -------------------------------- ### Development setup and basic commands Source: https://github.com/hstern/activesync-mcp/blob/main/CONTRIBUTING.md Commands for setting up the development environment and running basic tasks like testing and CI checks. ```sh git clone https://github.com/hstern/activesync-mcp cd activesync-mcp make # prints all available targets make test # unit tests under -race with coverage make ci # everything CI runs (lint + race tests + vulncheck) ``` -------------------------------- ### EAS layer mocking with easmock Source: https://github.com/hstern/activesync-mcp/blob/main/AGENTS.md Example of using easmock for tier-1 tool handler tests, demonstrating its advantages over httptest.Server. ```go mock := &easmock.Client{ EmailClient: easmock.EmailClient{ SyncEmailFunc: func(_ context.Context, fid string, _ eas.EmailSyncOptions) (*eas.EmailSyncResult, error) { return &eas.EmailSyncResult{Added: []eas.EmailItem{{Subject: "hi"}}}, nil }, }, } m := newMockManager(t, mock, mockManagerOpts{}) s := mcp.NewServer(&mcp.Implementation{Name: "t", Version: "0"}, nil) registerEmailReadTools(s, m.cfg, m) out := callTool(t, s, "email_list", EmailListInput{Account: "alpha", FolderID: "inbox-id"}) ``` -------------------------------- ### In-process MCP test pattern Source: https://github.com/hstern/activesync-mcp/blob/main/AGENTS.md Example of how to use in-process MCP transports for tier 1 and tier 2 tests. ```go ct, st := mcp.NewInMemoryTransports() s.Connect(t.Context(), st, nil) c := mcp.NewClient(...) cs, _ := c.Connect(t.Context(), ct, nil) res, _ := cs.CallTool(t.Context(), &mcp.CallToolParams{Name: "...", Arguments: ...}) ``` -------------------------------- ### Daily Commands Source: https://github.com/hstern/activesync-mcp/blob/main/AGENTS.md Common make commands for development and testing. ```makefile make ci # lint + race tests + coverage (PR gate) make integration # tier 2 — needs OS keyring; cross-platform make e2e # tier 3 — brings up ../go-activesync/testenv/$(STACK) make scenario # tier 4 — multi-call agent-shaped flows make fmt # gofmt -w (fix drift) ``` -------------------------------- ### Subcommands Source: https://github.com/hstern/activesync-mcp/blob/main/README.md List of available activesync-mcp subcommands and their usage. ```bash activesync-mcp serve [--config PATH] # run the MCP server (default) activesync-mcp keyring set --account NAME # store an account password activesync-mcp keyring get --account NAME # report whether one is set activesync-mcp keyring delete --account NAME activesync-mcp autodiscover --email ADDR # probe EAS endpoint for an email activesync-mcp doctor [--config PATH] # validate config + probe each account ``` -------------------------------- ### Testing Commands Source: https://github.com/hstern/activesync-mcp/blob/main/README.md Commands for running different tiers of tests for activesync-mcp. ```sh make test # tier 1 — fast unit tests make integration # tier 2 — real OS surfaces (keyring, bbolt, signals) make e2e # tier 3 — binary against real Z-Push (needs ../go-activesync/testenv) make scenario # tier 4 — multi-call agent-shaped flows make ci # tier 1 + lint ``` -------------------------------- ### Release Tagging Source: https://github.com/hstern/activesync-mcp/blob/main/CONTRIBUTING.md Push a tag following SemVer to trigger the release workflow. ```bash v0.2.0 ``` -------------------------------- ### Repository Layout Source: https://github.com/hstern/activesync-mcp/blob/main/AGENTS.md Directory structure of the activesync-mcp repository. ```markdown cmd/activesync-mcp/ CLI entry point + subcommands (serve / keyring / autodiscover / doctor) lib/config/ TOML parsing, secret resolution (keyring | command), per-account config lib/server/ MCP server build + tool registration + per-account Manager lib/store/ bbolt-backed eas.StateStore (PolicyKey + per-folder SyncKey) testdata/ e2e config fixtures .github/ workflows, dependabot, issue templates ``` -------------------------------- ### End-to-End Test Command Source: https://github.com/hstern/activesync-mcp/blob/main/CONTRIBUTING.md Run this command if your changes affect the end-to-end surface, after setting up the test environment. ```bash make e2e ``` -------------------------------- ### Running different test tiers Source: https://github.com/hstern/activesync-mcp/blob/main/CONTRIBUTING.md Commands to execute the four different tiers of tests: Unit, Integration, End-to-end, and Scenario. ```sh make test # tier 1 — fast, no deps make integration # tier 2 — needs OS keyring; runs in OS matrix in CI make e2e # tier 3 — needs ../go-activesync/testenv up make scenario # tier 4 — needs ../go-activesync/testenv up ``` -------------------------------- ### Repo Layout Source: https://github.com/hstern/activesync-mcp/blob/main/AGENTS.md A cheat sheet outlining the directory structure and key files within the activesync-mcp repository. ```plaintext cmd/activesync-mcp/ main.go entry point; subcommand dispatch keyring.go OS keyring set/get/delete subcommand autodiscover.go EAS endpoint discovery subcommand doctor.go config validation + per-account probe lib/config/ config.go TOML schema + load secrets.go keyring | command secret resolution access.go per-class read/write access control tls.go optional mTLS client cert config lib/server/ server.go Build(): wires every register*Tools() manager.go per-account eas.Client cache + CheckClass ntlm.go / kerberos.go auth-scheme transport wrappers push.go background Ping → MCP notifications/updated tools_email.go / tools_email_write.go tools_calendar.go tools_pim.go contacts + tasks + notes + GAL tools_extras.go folder management + OOF + ResolveRecipients + item_count lib/store/bbolt.go eas.StateStore impl: PolicyKey + per-folder SyncKey .github/workflows/ ci.yml lint + unit + integration matrix + e2e + scenario release.yml tag v* → cross-platform binary builds codeql.yml security scan ``` -------------------------------- ### Verify configuration Source: https://github.com/hstern/activesync-mcp/blob/main/README.md Use the doctor command to verify the activesync-mcp configuration and connection. ```sh activesync-mcp doctor # → work: OK (12.0, 12.1, 14.0 supported; negotiated 14.0) ``` -------------------------------- ### CI Check Command Source: https://github.com/hstern/activesync-mcp/blob/main/CONTRIBUTING.md Run this command to check your changes before pushing to ensure they meet project standards. ```bash make ci ``` -------------------------------- ### Store password in keyring Source: https://github.com/hstern/activesync-mcp/blob/main/README.md Store the password for a given account in the OS keyring. ```sh activesync-mcp keyring set --account work # (no-echo prompt for the password) ``` -------------------------------- ### Claude Desktop MCP server configuration Source: https://github.com/hstern/activesync-mcp/blob/main/README.md Configure Claude Desktop to use activesync-mcp as an MCP server. ```json { "mcpServers": { "activesync": { "command": "/usr/local/bin/activesync-mcp", "args": ["serve"] } } } ``` -------------------------------- ### Discover EAS endpoint Source: https://github.com/hstern/activesync-mcp/blob/main/README.md Use the autodiscover command to find the EAS endpoint for a given email address. ```sh activesync-mcp autodiscover --email you@example.com # → https://mail.example.com/Microsoft-Server-ActiveSync ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.