承接 vielhuber/exchangehelper 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vielhuber/exchangehelper

Composer 安装命令:

composer require vielhuber/exchangehelper

包简介

Exchange/Outlook/Microsoft Graph helper for contacts, calendar events and To Do tasks with an MCP server.

README 文档

README

build status GitHub Tag Code Style License Last Commit PHP Version Support Packagist Downloads

📇 exchangehelper 📇

exchangehelper is a helper for Exchange, Outlook and Microsoft 365.

it focuses on contacts, calendar events and Microsoft To Do lists/tasks. mail stays outside this package because it is already covered by mailhelper.

installation

install once with composer:

composer require vielhuber/exchangehelper

then add this to your files:

require __DIR__ . '/vendor/autoload.php';
use vielhuber\exchangehelper\exchangehelper;

setup

exchangehelper always reads Microsoft credentials from the .env in your project root. do not pass secrets in php.

create or extend your existing project .env:

EXCHANGEHELPER_GRAPH_TENANT_ID=example.onmicrosoft.com
EXCHANGEHELPER_GRAPH_CLIENT_ID=00000000-0000-0000-0000-000000000000
EXCHANGEHELPER_GRAPH_CLIENT_SECRET=secret
EXCHANGEHELPER_GRAPH_USER_ID=user@example.com

exchangehelper uses Microsoft Graph application permissions. this is the server-to-server flow:

  1. open entra app registrations and create a new app registration.
  2. copy application (client) id to EXCHANGEHELPER_GRAPH_CLIENT_ID and directory (tenant) id to EXCHANGEHELPER_GRAPH_TENANT_ID.
  3. create a client secret under certificates & secrets and copy its value to EXCHANGEHELPER_GRAPH_CLIENT_SECRET.
  4. open api permissions, click add a permission, choose Microsoft Graph, then choose application permissions.
  5. search and add these permissions:
    • Contacts.ReadWrite
    • Calendars.ReadWrite
    • Tasks.Read.All
    • Tasks.ReadWrite.All
  6. click grant admin consent for the tenant and confirm the prompt. the status column should show a green checkmark for every permission.
  7. set EXCHANGEHELPER_GRAPH_USER_ID to the mailbox user, for example user@example.com.
EXCHANGEHELPER_GRAPH_TENANT_ID=example.onmicrosoft.com
EXCHANGEHELPER_GRAPH_CLIENT_ID=00000000-0000-0000-0000-000000000000
EXCHANGEHELPER_GRAPH_CLIENT_SECRET=secret
EXCHANGEHELPER_GRAPH_USER_ID=user@example.com
$exchange = new exchangehelper();

usage

contacts

$contacts = $exchange->getContacts(query: 'David', limit: 10);
$contact = $exchange->getContact(id: $contacts[0]['id']);

$created = $exchange->addContact([
    'display_name' => 'Ada Lovelace',
    'emails' => ['ada@example.com'],
    'phones' => [
        'mobile' => '+491701234567'
    ],
    'company_name' => 'Analytical Engines Ltd.'
]);

$updated = $exchange->updateContact(id: $created['id'], data: [
    'job_title' => 'Mathematician'
]);

$exchange->removeContact(id: $created['id']);

calendar

$events = $exchange->getCalendarEvents(
    start: '2026-05-01T00:00:00Z',
    end: '2026-05-31T23:59:59Z',
    limit: 50
);

$event = $exchange->addCalendarEvent([
    'subject' => 'Project sync',
    'start' => '2026-05-21T10:00:00',
    'end' => '2026-05-21T10:30:00',
    'timezone' => 'Europe/Berlin',
    'location' => 'Teams',
    'attendees' => ['ada@example.com']
]);

$exchange->removeCalendarEvent(id: $event['id']);

to do

$lists = $exchange->getTodoLists();
$tasks = $exchange->getTodoTasks(list_id: $lists[0]['id']);

$task = $exchange->addTodoTask(list_id: $lists[0]['id'], data: [
    'title' => 'Prepare meeting',
    'body' => 'Collect notes',
    'due' => '2026-05-21T18:00:00',
    'timezone' => 'Europe/Berlin'
]);

$exchange->updateTodoTask(list_id: $lists[0]['id'], id: $task['id'], data: [
    'status' => 'completed'
]);

mcp server

exchangehelper ships as a standalone mcp server for ai-agent workflows.

# run this from your project root where .env lives
vendor/bin/mcp-server.php

the server speaks both stdio (CLI invocation) and HTTP via simplemcp. auth: 'static' mode expects the bearer token in MCP_TOKEN from your project .env.

available tools:

  • contacts_search(query?, limit?)
  • contacts_get(id)
  • calendar_list_events(start?, end?, limit?)
  • todo_list_lists()
  • todo_list_tasks(list_id?)
  • todo_create_task(list_id, title, body?, due?)

tests

the test suite reads the project .env. if Microsoft Graph credentials are present, it runs one live test against that server; otherwise the live test is skipped. the live test only creates/update/deletes its own exchangehelper integration ... test entries:

vendor/bin/phpunit

统计信息

  • 总下载量: 19
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-05-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固