{"_id":"x-agent-sdk","_rev":"13-fefee7d39df90a761b1c675bdcbce140","name":"x-agent-sdk","dist-tags":{"latest":"0.2.3"},"versions":{"0.1.2":{"name":"x-agent-sdk","version":"0.1.2","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.1.2","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent#readme","bugs":{"url":"https://github.com/alarok/x-agent/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"a29b319efe03b000185f6c6412e55703f3710f32","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.1.2.tgz","fileCount":14,"integrity":"sha512-QULyJw9P3/WqW9rYjp4B6lJnjSQkd3NSG+mJPd6SkGqZmIMvdTN9jjCiTPb51pRo3bS9yKBtHne40oHi3wGBBA==","signatures":[{"sig":"MEQCIHHyB3uyjCz9SGgoK+2n8U8k7PNTSDamoSpbj0opmZ3KAiANKPmKClTug30TM7W0ggmR4p9b+ztabwZFFR5pZyRkZQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84296},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"bfb08d7748dd1723e6c0595af5aa56bbdc150525","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent.git","type":"git"},"_npmVersion":"11.17.0","description":"Agent-native client for X (Twitter) via its internal GraphQL API. Cookie auth, automatic x-client-transaction-id, and a ready-to-plug MCP server so AI agents can post, read and search X with zero glue code.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.12.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.1.2_1785979277657_0.22800855626074812","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"x-agent-sdk","version":"0.1.3","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.1.3","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent#readme","bugs":{"url":"https://github.com/alarok/x-agent/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"f154526866b9b9b1ecb13950eee66dcc4e1e7e75","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.1.3.tgz","fileCount":14,"integrity":"sha512-i9jeMqtU3wEJJGuB2YkrJ2TLPW94AU+fHCkTXCcuZ9rQ4YNAmgQhdToS6V++rZdM+rXGIROZe8Ca22q73+sGsw==","signatures":[{"sig":"MEUCIEG2Ic5ncqEUXcuSaudr6s82vtuNV618UKr2TYGlAYW1AiEA+ZydtJ52DeaspW3F/uYtsA68/HXZ6rBNpFQjKzkc658=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84344},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"bfb08d7748dd1723e6c0595af5aa56bbdc150525","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent.git","type":"git"},"_npmVersion":"11.17.0","description":"Agent-native client for X (Twitter) via its internal GraphQL API. Cookie auth, automatic x-client-transaction-id, and a ready-to-plug MCP server so AI agents can post, read and search X with zero glue code.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.12.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.1.3_1785979373197_0.08624258089891801","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"x-agent-sdk","version":"0.1.4","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.1.4","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent#readme","bugs":{"url":"https://github.com/alarok/x-agent/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"82e9c192a560ce25be77c7680e2ab058370dc129","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.1.4.tgz","fileCount":14,"integrity":"sha512-5fiJ8VzdpjQudJS4lm1bFljKZhbiGDSc0yX5LJumzRG1Hvs+hqjV2U+YdSXtfh9z9fVpZpI9B12V3nbobxzEFQ==","signatures":[{"sig":"MEUCIAjqZ983uDD/SM8CVkf7Qru7iRZlGzIQYrJotMv/OdTNAiEAln2BG5JJUXaaqXoggpUwpbVC0TzZtZKmjqsQrptzB/Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84344},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"7ac424e6bb6c44994003b6546162f7c22325a62c","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent.git","type":"git"},"_npmVersion":"11.17.0","description":"Agent-native client for X (Twitter) via its internal GraphQL API. Cookie auth, automatic x-client-transaction-id, and a ready-to-plug MCP server so AI agents can post, read and search X with zero glue code.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.1.4_1785980027616_0.6624455010851191","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"x-agent-sdk","version":"0.1.5","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.1.5","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent#readme","bugs":{"url":"https://github.com/alarok/x-agent/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"e4cddcd936da340a92c9b379d86b1f14daf2f506","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.1.5.tgz","fileCount":14,"integrity":"sha512-7rs3FPwMiGhcI6Li9/ZhhmqpNLhrJmSwk0cYDiUNqz2CHzhhHKgKvfY1PCpCt+Lvr2padNMM5GiQl6YuwhNuRQ==","signatures":[{"sig":"MEQCIBI3Dl/sshEgJEPX1Akgg7thYUSxDT4Yj6IcdSwQY/wyAiAYGgcBUwYbIv1wy6305BEF4gKrIzj+hVSo012o2OFqfA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84627},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"a2006594b21d948b267fb611985f00982aba5d4b","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent.git","type":"git"},"_npmVersion":"11.17.0","description":"Agent-native client for X (Twitter) via its internal GraphQL API. Cookie auth, automatic x-client-transaction-id, and a ready-to-plug MCP server so AI agents can post, read and search X with zero glue code.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.1.5_1785980862310_0.1393547784881417","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"x-agent-sdk","version":"0.1.6","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.1.6","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent#readme","bugs":{"url":"https://github.com/alarok/x-agent/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"c85dbeabdbf728cbaf2ea5862cef9611701ce0fc","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.1.6.tgz","fileCount":14,"integrity":"sha512-LfkHDB9SuOppEVHKUekdGCYBiuug/nwjiA3qHd/s0hiB4wmj/BVXfS4MB7tiPODocOte7k+QM2YZF+uVRZJr7Q==","signatures":[{"sig":"MEYCIQDRzigbHFjhuD6H904beP5Xn5mYfuknfR+oQ+/T/brSngIhALHLNuPIgtGnoI7yv1+4uLfpI1atFwc13506kGpraZc7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84380},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"4e545a47ef900934f322b8c39acb9f330a174c62","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent.git","type":"git"},"_npmVersion":"11.17.0","description":"Agent-native client for X (Twitter) via its internal GraphQL API. Cookie auth, automatic x-client-transaction-id, and a ready-to-plug MCP server so AI agents can post, read and search X with zero glue code.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.1.6_1785981079730_0.2404090497414444","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"x-agent-sdk","version":"0.1.7","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.1.7","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent#readme","bugs":{"url":"https://github.com/alarok/x-agent/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"a65c1b7db3ceca302dcad3bda120022c77a4f15c","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.1.7.tgz","fileCount":14,"integrity":"sha512-11FPA18Qxe4hsNMMah4R/XqsDZiGL4MHqGK9s/lbMf1Rt1k4sGiKdxOUQu6ineR0fvs2CoxepCQsc86epsPEKw==","signatures":[{"sig":"MEQCIHZRDXh3DIrJ2l1s6cA20zic4hZ3H9YZLS+x1yUuTW+RAiBQm3Ss3wYbfg3z5aaigApuzsoMvGRPPxFoH1gpHXGkjg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84243},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"774f28df287ba560122e99c3551bccf33550c10f","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent.git","type":"git"},"_npmVersion":"11.17.0","description":"Unofficial X (Twitter) client + MCP server. Cookie auth, no paid API.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.1.7_1785981194131_0.4346910292624726","host":"s3://npm-registry-packages-npm-production"}},"0.1.8":{"name":"x-agent-sdk","version":"0.1.8","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.1.8","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent#readme","bugs":{"url":"https://github.com/alarok/x-agent/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"b2bac072ad39a621a50d452288525c34882f9c1c","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.1.8.tgz","fileCount":14,"integrity":"sha512-lkJrlJrxbfc7C819swmi8Niil/+dBE2ioELc3919B+a31kKXT13nKfyrJs/24A0zQPulZ8kTbLVom2WvodcSMA==","signatures":[{"sig":"MEUCIQCudDdfmdVkYJHs/P6q6RYsBhXqByf+2uYCzDIjZXGU5gIgf5PGK1g1+mzVGKzmr/mFc6FIoClkusDESKGlIDhEoOU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":86350},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"dc1c90e5d52038e320d4ef833add87275e002090","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent.git","type":"git"},"_npmVersion":"11.17.0","description":"Unofficial X (Twitter) client + MCP server. Cookie auth, no paid API.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.1.8_1786008232756_0.04605359140339882","host":"s3://npm-registry-packages-npm-production"}},"0.1.9":{"name":"x-agent-sdk","version":"0.1.9","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.1.9","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent-sdk#readme","bugs":{"url":"https://github.com/alarok/x-agent-sdk/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"1cd0061ce36e3acb5f492518d17964b85afb0035","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.1.9.tgz","fileCount":16,"integrity":"sha512-hN8/mJlQxu4AAotMKy0264M6iMwrzyH849Csux5YuXNLk4u9eOLnYx/y4P1bvy8pq26Hl44CnZwQ+00PyDlwEQ==","signatures":[{"sig":"MEYCIQDq2CyG0VhHWvsa/+RMNz7vkCg1JPNtunpiUIDXNmwh2wIhAJl6y5n421maL4Zewx2p3zmd2ZERl23qN67TTdfZEdx6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92651},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"61edcdff9aa8e5445d80303bc9c8e6726f6bc1b7","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent-sdk.git","type":"git"},"_npmVersion":"11.17.0","description":"Unofficial X (Twitter) client + MCP server. Cookie auth, no paid API.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.1.9_1786008717897_0.5084989635657504","host":"s3://npm-registry-packages-npm-production"}},"0.1.10":{"name":"x-agent-sdk","version":"0.1.10","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.1.10","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent-sdk#readme","bugs":{"url":"https://github.com/alarok/x-agent-sdk/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"627572ce3a1579ddde3fcd5c22ba2c8c0b279df9","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.1.10.tgz","fileCount":16,"integrity":"sha512-6UAjmIxz5Tx/FRxEcr0hlV3tRgsl1lN/eqDW6wcMIwtyQt7tUlYuWoYeXRE0cTTLEeTPWxwf074BWatTbc8AoQ==","signatures":[{"sig":"MEYCIQCjkSlZUBVvX2Tac+uEIv5WbBuJGPT6AseI602JugNiGgIhAJ5R9iTD5sNRV0zNZ9PYSxXcbZOeAriM4z77ovJoG2dd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":95183},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"e3da3b62301c4832486181c7aae6c00809ba7a01","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent-sdk.git","type":"git"},"_npmVersion":"11.17.0","description":"Unofficial X (Twitter) client + MCP server. Cookie auth, no paid API.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.1.10_1786009326498_0.43399270019582015","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"x-agent-sdk","version":"0.2.0","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.2.0","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent-sdk#readme","bugs":{"url":"https://github.com/alarok/x-agent-sdk/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"630feb8afec019b524d170826e90626a244d1cf3","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.2.0.tgz","fileCount":16,"integrity":"sha512-AKI4s/k0txSs4GFmKF/04p3oheWJVJUd/9udp5OcGaYG/fCliDWGuWlPMIYamoxEzSjgAypFo6YO0saHr3Smjw==","signatures":[{"sig":"MEQCIGpze6eV9BQ0LFFDt9laFvnuivDyyaSvRKKdmIq8qbNsAiAehoHpWS2U0cHoyhbr1m2Y9sLquGii6PeAVzaHilBAhA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102747},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"95459c03891bce560a96de478b85e1a7790e4fe7","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent-sdk.git","type":"git"},"_npmVersion":"11.17.0","description":"Unofficial X (Twitter) client + MCP server. Cookie auth, no paid API.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.2.0_1786009776124_0.587121682933563","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"x-agent-sdk","version":"0.2.1","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.2.1","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent-sdk#readme","bugs":{"url":"https://github.com/alarok/x-agent-sdk/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"59e554f05711cbf7f9ee4e8b507e551d8a297bae","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.2.1.tgz","fileCount":16,"integrity":"sha512-UXmeDtjKvc2vV1siZizDRFrZV9AgH3mpXfcY5J4w3bP8mYbkFWrTABPvBQVDsKJWgJSWr3771gNYRwrF9mGM9w==","signatures":[{"sig":"MEQCIBZ4gnrnBJI8rJPY+FBDc/f8uZCC341TjIWruxcxnruTAiAWB9jj1BpHFTb4nRHKa6wZqSBi/yxqRL+LPZxJQeRRZg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102745},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"0c67289bf42eb48a16689b4c4d3690f14086ad51","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent-sdk.git","type":"git"},"_npmVersion":"11.17.0","description":"Unofficial X (Twitter) client + MCP server. Cookie auth, no paid API.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.2.1_1786009841621_0.7829325685064379","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"x-agent-sdk","version":"0.2.2","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"author":{"name":"Alarok"},"license":"MIT","_id":"x-agent-sdk@0.2.2","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"homepage":"https://github.com/alarok/x-agent-sdk#readme","bugs":{"url":"https://github.com/alarok/x-agent-sdk/issues"},"bin":{"x-agent-mcp":"dist/mcp.js"},"dist":{"shasum":"429cfa16c67b00ddee7397502fb6d831fee800c8","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.2.2.tgz","fileCount":16,"integrity":"sha512-2GufCF8xwthLzucFhnsFk4KBXJjvjDVd5zWWUp0uFH31bDXY5BgjauRF16qDrkg5wWYsJGkbmOU2nEungMfqUA==","signatures":[{"sig":"MEUCIBUJfF8A0gUpqDSeFbQNmljknOxA5L/BLmgOy/Qqav5AAiEAuiBJiUgZPW3VFD+rE3atZqn0j2/jXU8Zu43cGGO696E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":102747},"type":"module","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"}},"gitHead":"087a848d04b8ad4056e9fe177e57ce1bb745fb35","scripts":{"test":"bun test","build":"tsc","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"repository":{"url":"git+https://github.com/alarok/x-agent-sdk.git","type":"git"},"_npmVersion":"11.17.0","description":"Unofficial X (Twitter) client + MCP server. Cookie auth, no paid API.","directories":{},"_nodeVersion":"26.5.0","dependencies":{"zod":"^3.23.8","node-html-parser":"^9.0.0","@modelcontextprotocol/sdk":"^1.30.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/x-agent-sdk_0.2.2_1786009922597_0.49499919468299236","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"x-agent-sdk","version":"0.2.3","description":"Unofficial X (Twitter) client + MCP server. Cookie auth, no paid API.","type":"module","license":"MIT","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./tools":{"types":"./dist/tools.d.ts","import":"./dist/tools.js"},"./mcp":{"types":"./dist/mcp.d.ts","import":"./dist/mcp.js"}},"bin":{"x-agent-mcp":"dist/mcp.js"},"author":{"name":"Alarok"},"repository":{"type":"git","url":"git+https://github.com/alarok/x-agent-sdk.git"},"bugs":{"url":"https://github.com/alarok/x-agent-sdk/issues"},"homepage":"https://github.com/alarok/x-agent-sdk#readme","scripts":{"build":"tsc","test":"bun test","dev:mcp":"bun run src/mcp.ts","start:mcp":"node dist/mcp.js","prepublishOnly":"npm run build"},"dependencies":{"@modelcontextprotocol/sdk":"^1.30.0","node-html-parser":"^9.0.0","zod":"^3.23.8"},"devDependencies":{"typescript":"^5.6.0","@types/node":"^22.0.0"},"engines":{"node":">=18"},"gitHead":"a691593e1f0e99b1fcbdd1341829d81ed4560fc2","_id":"x-agent-sdk@0.2.3","_nodeVersion":"26.5.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-4oBa7uZgaGoklk7tD10LIJsD8dbTin1feCUhzm/iQ6nWgbkYPUNcAzawhaoW0Iu5EIY68lwc9FsybdOUCbHgrw==","shasum":"b57244fd48f0802b385a1a4e4a7970c6ac44cec4","tarball":"https://registry.npmjs.org/x-agent-sdk/-/x-agent-sdk-0.2.3.tgz","fileCount":16,"unpackedSize":106116,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG0aSJMPn32RoXkk+cV/QYWXX9qB6A4344iqoodisAHzAiEA/ZSTwRue9SxQnb/N+jxhSgFFnB4dJSX0gNfRZdxL3Jk="}]},"_npmUser":{"name":"alarok","email":"alarok@proton.me"},"directories":{},"maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/x-agent-sdk_0.2.3_1786011063530_0.6350717898235279"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-06T01:21:17.474Z","modified":"2026-08-06T10:11:03.826Z","0.1.2":"2026-08-06T01:21:17.805Z","0.1.3":"2026-08-06T01:22:53.340Z","0.1.4":"2026-08-06T01:33:47.773Z","0.1.5":"2026-08-06T01:47:42.484Z","0.1.6":"2026-08-06T01:51:19.860Z","0.1.7":"2026-08-06T01:53:14.288Z","0.1.8":"2026-08-06T09:23:52.917Z","0.1.9":"2026-08-06T09:31:58.029Z","0.1.10":"2026-08-06T09:42:06.640Z","0.2.0":"2026-08-06T09:49:36.326Z","0.2.1":"2026-08-06T09:50:41.763Z","0.2.2":"2026-08-06T09:52:02.742Z","0.2.3":"2026-08-06T10:11:03.679Z"},"bugs":{"url":"https://github.com/alarok/x-agent-sdk/issues"},"author":{"name":"Alarok"},"license":"MIT","homepage":"https://github.com/alarok/x-agent-sdk#readme","keywords":["twitter","x","mcp","ai-agent","llm","tools","graphql","automation","typescript","sdk","cookie-auth"],"repository":{"type":"git","url":"git+https://github.com/alarok/x-agent-sdk.git"},"description":"Unofficial X (Twitter) client + MCP server. Cookie auth, no paid API.","maintainers":[{"name":"alarok","email":"alarok@proton.me"}],"readme":"<div align=\"center\">\n\n<img src=\"https://raw.githubusercontent.com/alarok/x-agent-sdk/main/assets/x-agent-x-header.png\" alt=\"x-agent banner\" width=\"100%\" />\n\n# x-agent-sdk\n\n**Unofficial X (Twitter) client — for your own code and for AI agents alike.**\n\nUse it as a typed TypeScript library, or drop in its MCP server so agents connect directly.\nAll through the same private GraphQL API the web app uses.\n\nCookie auth · no OAuth · no paid API · automatic `x-client-transaction-id` · multi-account · cookie-free public reads · built-in MCP server\n\n</div>\n\n> [!WARNING]\n> **Use at your own risk.** This is an unofficial tool that talks to X's private\n> API with your session cookies, which may breach X's Terms of Service. It can get\n> your account **rate-limited, shadow-banned, suspended, or permanently\n> terminated**. The author takes **no responsibility** for any bans, damages, or\n> losses. You alone are responsible for how you use it and for complying with X's\n> ToS and applicable law. Educational and personal use only.\n\n---\n\n## Agent setup guide\n\nThis package ships a [`SKILL.md`](./SKILL.md) with operating instructions for AI agents:\nMCP setup, credential handling, tool choice, and known X API quirks. Use the prompt below to\nconfigure the MCP server on this machine.\n\n```text\nSet up x-agent on this machine.\n\nThe package is on npm:\n  https://www.npmjs.com/package/x-agent-sdk\nThe source and agent guide live at:\n  https://github.com/alarok/x-agent-sdk\n\nWorkflow:\n1. Read the full agent guide first:\n   https://github.com/alarok/x-agent-sdk/blob/main/SKILL.md\n2. Start the MCP server without installing anything:\n   npx -y x-agent-mcp\n   Or install once and run it:\n   npm install -g x-agent-sdk && x-agent-mcp\n3. Register the MCP server with the MCP client already installed on this\n   machine. If the client is Claude Code, use:\n   claude mcp add x-agent --env AUTH_TOKEN=... --env CT0=... -- npx -y x-agent-mcp\n   For Hermes or other clients, follow the config blocks in the README.\n   If the client is unclear, inspect the local configuration and ask me\n   before making assumptions.\n4. x-agent requires these private environment variables:\n   - AUTH_TOKEN: the auth_token cookie from a logged-in x.com session\n   - CT0: the ct0 cookie from that same session\n   - For multiple accounts, use X_ACCOUNTS instead (see \"Multiple accounts\").\n   Ask me for them if they are not already configured. Never print, log,\n   commit, expose, or include either value in command output.\n5. Verify setup with a read-only action, such as get_user for username \"x\".\n   Do not post, reply, like, repost, follow, bookmark, delete, or send a DM\n   without first showing me the intended action and receiving explicit approval.\n\nIf any step fails, inspect the actual error and propose the smallest safe fix.\nAt the end, summarize the MCP configuration, the command used to run it, and\nthe available read-only tools.\n```\n\n---\n\n## What is this?\n\nX killed its free public API in 2023. But the web client at `x.com` still talks to\na private GraphQL API using nothing but your session cookies. `x-agent` drives that\nAPI directly — post, reply, like, retweet, search, read timelines — with two ways in:\n\n- **As a library** — a typed TypeScript client you call from your own code, to build\n  a bot, a scheduler, a scraper, or any automation you want.\n- **As an MCP server** — drop it into any Model Context Protocol agent (Claude\n  Desktop, Cursor, iris, ...) and it discovers the tools automatically.\n\nSame engine underneath; pick whichever fits.\n\n### Why a plain HTTP client fails\n\nHitting X's private API with a plain HTTP client returns a misleading\n`error 344 \"You have reached your daily limit\"` **even on a fresh account with 2\ntweets**. That is *not* a quota — it's anti-bot. The browser signs every request\nwith a per-request `x-client-transaction-id` header. `x-agent` generates that\nheader for you, in-process, on every call — with zero third-party crypto.\n\n---\n\n## Install\n\n```bash\nbun add x-agent-sdk          # or:  npm install x-agent-sdk\n```\n\nInstalling from source instead (git clone): run `bun install && bun run build` first.\n\nRuns on **Node 18+** and **Bun**. Dependencies are all generic infrastructure:\n`@modelcontextprotocol/sdk` (the MCP server), `node-html-parser` (reads X's home\npage), `zod` (tool schemas). No transaction-id package — that algorithm lives in\nthis repo.\n\n## Credentials\n\nTwo cookies from a logged-in `x.com` session:\n\n| Cookie | What it is |\n|--------|------------|\n| `auth_token` | Your session token |\n| `ct0` | CSRF token (sent as both cookie and header) |\n\nCopy them from your browser's dev tools while logged in at `x.com`:\n\n| Browser | Where |\n|---------|-------|\n| Chrome / Edge / Brave | F12 → **Application** → **Cookies** → `https://x.com` |\n| Firefox | F12 → **Storage** → **Cookies** → `https://x.com` |\n| Safari | Develop → **Show Web Inspector** → **Storage** → **Cookies** (enable the Develop menu first: Settings → Advanced → *Show features for web developers*) |\n\nProvide via env (`AUTH_TOKEN`, `CT0`) or pass to the constructor.\n\nNeed more than one account? Every `XClient` holds one account's cookies, so\ncreate one client per account — see [Multiple accounts](#multiple-accounts).\n\n---\n\n## Quick start (library)\n\n```ts\nimport { XClient } from \"x-agent-sdk\";\n\nconst x = new XClient();               // reads AUTH_TOKEN / CT0 from env\n// const x = new XClient({ authToken: \"...\", ct0: \"...\" });\n\n// Post\nconst id = await x.postTweet(\"hello from an agent\");\nconsole.log(`https://x.com/i/web/status/${id}`);\n\n// Reply\nawait x.reply(id, \"and a threaded reply\");\n\n// Read a tweet's engagement + replies (clean shape)\nconst { root, replies } = await x.getThread(id);\nconsole.log(`${root.likes} likes, ${root.replies} replies, ${root.views} views`);\nfor (const r of replies) console.log(`  @${r.author}: ${r.text} (${r.likes} likes)`);\n\n// Search\nfor (const t of await x.search(\"typescript\", 10, \"Latest\")) {\n  console.log(t.url, \"-\", t.text);\n}\n\n// Resolve a handle, then read their tweets\nconst user = await x.getUser(\"x\");\nconst tweets = await x.getUserTweets(user.rest_id, 20);\n\n// Engage\nawait x.like(id);\nawait x.retweet(id);\nawait x.bookmark(id);\n```\n\n### API\n\n| Method | Returns | Notes |\n|--------|---------|-------|\n| `postTweet(text, replyTo?, opts?)` | tweet id | `opts.quoteTweetUrl` makes it a quote tweet |\n| `reply(tweetId, text)` | tweet id | Shorthand for `postTweet(text, tweetId)` |\n| `quote(urlOrId, text)` | tweet id | Quote-tweet; resolves the handle if given a bare id |\n| `deleteTweet(id)` | `boolean` | |\n| `like(id)` / `unlike(id)` | `boolean` | |\n| `retweet(id)` / `unretweet(id)` | `boolean` | |\n| `bookmark(id)` / `unbookmark(id)` | `boolean` | |\n| `follow(userId)` / `unfollow(userId)` | `boolean` | Numeric id — uses X's REST v1.1 endpoint |\n| `search(query, count?, product?)` | `Tweet[]` | `product`: `Top` \\| `Latest` \\| `People` \\| `Media` |\n| `getUser(username)` | user object | Has `rest_id` (the numeric id) |\n| `getUserTweets(userId, count?)` | `Tweet[]` | Needs numeric id — resolve via `getUser` |\n| `getLikes(userId, count?)` | `Tweet[]` | Tweets a user liked |\n| `getFollowers(userId, count?)` | `XUser[]` | A user's followers |\n| `getFollowing(userId, count?)` | `XUser[]` | Who a user follows |\n| `homeTimeline(count?)` | `Tweet[]` | \"For You\" |\n| `sendDM(recipientId, text)` | raw | DM a user (your own id auto-resolved) |\n| `getDMInbox()` | raw | Conversations + recent messages |\n| `getNotifications(count?)` | raw | Likes, follows, replies |\n| `getMentions(count?)` | raw | Tweets mentioning you |\n| `myUserId()` | `string` | Your account's numeric id, cached |\n| `getLastRateLimit()` | `RateLimitInfo \\| null` | Last `x-rate-limit-remaining/reset/limit` seen, or `null` before the first call |\n| `getTweet(id)` | raw response | Full `TweetDetail` payload |\n| `getTweetPublic(id)` | parsed tweet \\| `null` | **No cookies needed** — reads via the public FxTwitter API. `null` if deleted/private/non-existent |\n| `getThread(id)` | `{ root, replies }` | Parsed likes/replies/views — use this over `getTweet` for engagement |\n\n**Pagination** — every timeline has a `*Page` variant returning `{ items, next_cursor }`:\n\n| Method | Returns | Notes |\n|--------|---------|-------|\n| `getUserTweetsPage(userId, count?, cursor?)` | `Page<Tweet>` | `next_cursor` is `null` on the last page |\n| `getLikesPage(userId, count?, cursor?)` | `Page<Tweet>` | |\n| `getFollowersPage(userId, count?, cursor?)` | `Page<XUser>` | |\n| `getFollowingPage(userId, count?, cursor?)` | `Page<XUser>` | |\n| `searchPage(query, count?, product?, cursor?)` | `Page<Tweet>` | |\n| `homeTimelinePage(count?, cursor?)` | `Page<Tweet>` | |\n\n```ts\nlet cursor: string | undefined;\ndo {\n  const { items, next_cursor } = await x.searchPage(\"typescript\", 10, \"Latest\", cursor);\n  for (const t of items) console.log(t.url, \"-\", t.text);\n  cursor = next_cursor ?? undefined;\n} while (cursor);\n```\n\n`new XClient({ retries })` sets the retry budget for `344`/`429` (default 3).\n\nTwo more options for agent-facing code:\n\n- `new XClient({ fetch })` injects a custom HTTP client — plug a\n  curl-impersonate-style transport here to mimic Chrome's TLS fingerprint.\n- `new XClient({ onRateLimit })` fires with `{ remaining, reset, limit }`\n  after each response that carries X's rate-limit headers; `getLastRateLimit()`\n  returns the last one. Call it before a burst to check the remaining budget.\n\n---\n\n## Use it as an MCP server (recommended for agents)\n\nConnect the MCP server and the agent auto-discovers all 25 tools — names,\ndescriptions, JSON schemas. No glue code.\n\n### Config\n\n**Any MCP client (Claude Desktop, Cursor, Windsurf, ...)** — add to the MCP config:\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"x\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"x-agent-mcp\"],\n      \"env\": {\n        \"AUTH_TOKEN\": \"your_auth_token_cookie\",\n        \"CT0\": \"your_ct0_cookie\"\n      }\n    }\n  }\n}\n```\n\n**Claude Code** — one command, no JSON file:\n\n```bash\nclaude mcp add x-agent \\\n  --env AUTH_TOKEN=your_auth_token_cookie \\\n  --env CT0=your_ct0_cookie \\\n  -- npx -y x-agent-mcp\n```\n\n**Hermes Agent** — add to `~/.hermes/config.yaml`:\n\n```yaml\nmcp_servers:\n  x:\n    command: \"npx\"\n    args: [\"-y\", \"x-agent-mcp\"]\n    env:\n      AUTH_TOKEN: \"...\"\n      CT0: \"...\"\n```\n\nRestart the agent. It now has these tools:\n\n| Tool | Does |\n|------|------|\n| `post_tweet` | Publish a tweet (or reply via `reply_to`). Returns the URL. |\n| `quote_tweet` | Quote another tweet with your commentary |\n| `delete_tweet` | Delete a tweet by id |\n| `like_tweet` / `unlike_tweet` | Like / unlike |\n| `retweet` / `unretweet` | Retweet / undo |\n| `bookmark` / `unbookmark` | Save / remove a bookmark |\n| `follow_user` / `unfollow_user` | Follow / unfollow by user id |\n| `search_tweets` | Search (`Top`/`Latest`/`People`/`Media`) |\n| `get_user` | Resolve `@handle` → profile + counts |\n| `get_user_tweets` | Recent tweets by user id |\n| `get_likes` | Tweets a user liked |\n| `get_followers` / `get_following` | List followers / following |\n| `get_tweet` | Raw tweet + thread |\n| `get_tweet_public` | Read a tweet **without cookies** (public FxTwitter API). `null` if deleted/private |\n| `get_thread` | Clean `{ root: {likes, replies, ...}, replies: [...] }` |\n| `home_timeline` | The For You timeline |\n| `send_dm` | Send a direct message by user id |\n| `get_dm_inbox` | Conversations + recent messages |\n| `get_notifications` | Recent notifications |\n| `get_mentions` | Tweets mentioning you |\n\nNow you can tell the agent: *\"search X for the latest posts about Bun and reply to\nthe top one with a question\"* — it calls `search_tweets` then `post_tweet` by itself.\n\nTimeline tools (`search_tweets`, `get_user_tweets`, `get_likes`, `get_followers`,\n`get_following`, `home_timeline`) return a `next_cursor`; pass it back as `cursor`\nto fetch the next page.\n\n### Try the MCP server by hand\n\n```bash\nAUTH_TOKEN=... CT0=... npx -y x-agent-mcp\n# speaks MCP over stdio; connect any MCP client to list/call tools\n```\n\n---\n\n## Multiple accounts\n\nOne `XClient` holds one account's cookies. Use the library with several\naccounts by creating one client per account:\n\n```ts\nconst work = new XClient({ authToken: \"...\", ct0: \"...\" });\nconst personal = new XClient({ authToken: \"...\", ct0: \"...\" });\n\nawait work.postTweet(\"from the work account\");\nawait personal.postTweet(\"from the personal account\");\n```\n\nThe MCP server takes it further: pass `X_ACCOUNTS` — a JSON object mapping an\naccount name to its cookies — and every tool gains an optional `account`\nparam to pick which account to use. Omit `account` to use the `default`\naccount (or the only configured one). Unknown names fail with the list of\navailable accounts.\n\n```jsonc\n{\n  \"mcpServers\": {\n    \"x\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"x-agent-mcp\"],\n      \"env\": {\n        \"X_ACCOUNTS\": \"{\\\"default\\\":{\\\"authToken\\\":\\\"...\\\",\\\"ct0\\\":\\\"...\\\"},\\\"work\\\":{\\\"authToken\\\":\\\"...\\\",\\\"ct0\\\":\\\"...\\\"}}\"\n      }\n    }\n  }\n}\n```\n\n**Claude Code:**\n\n```bash\nclaude mcp add x-agent \\\n  --env 'X_ACCOUNTS={\"default\":{\"authToken\":\"...\",\"ct0\":\"...\"},\"work\":{\"authToken\":\"...\",\"ct0\":\"...\"}}' \\\n  -- npx -y x-agent-mcp\n```\n\n**Hermes Agent** (`~/.hermes/config.yaml`):\n\n```yaml\nmcp_servers:\n  x:\n    command: \"npx\"\n    args: [\"-y\", \"x-agent-mcp\"]\n    env:\n      X_ACCOUNTS: '{\"default\":{\"authToken\":\"...\",\"ct0\":\"...\"},\"work\":{\"authToken\":\"...\",\"ct0\":\"...\"}}'\n```\n\n`X_ACCOUNTS` wins over `AUTH_TOKEN` / `CT0` when both are set. Write actions\nare public — when an agent manages several accounts, tell it explicitly which\naccount to use before it posts.\n\n---\n\n## Watch mode (for agents)\n\nX has no push channel (no webhooks, no streaming) on the cookie API — the web\napp itself polls. So watch means: poll with the `*Page` methods, diff tweet\nids, and report only what is new. A scheduled script beats a long-lived loop:\nsame result, a fraction of the rate-limit cost.\n\n```js\n// watch.mjs — prints only new tweets for a search; run on a schedule.\n// A copy lives in the repo at examples/watch.mjs.\nimport { readFileSync, appendFileSync, writeFileSync } from \"node:fs\";\nimport { XClient } from \"x-agent-sdk\";\n\nconst x = new XClient(); // AUTH_TOKEN / CT0 from env\nconst QUERY = process.env.WATCH_QUERY ?? \"typescript\"; // search to watch\nconst STATE = process.env.WATCH_STATE ?? \".watch-state\"; // dedup state\nconst LOG = process.env.WATCH_LOG; // optional: append to a markdown log\n\n// State file: first line is the last known rate-limit budget (\"rl:N\").\nlet body = \"\";\ntry {\n  body = readFileSync(STATE, \"utf8\");\n} catch {\n  /* first run: no state yet */\n}\nconst [head = \"\", ...rest] = body.split(\"\\n\");\nconst lastRemaining = Number(head.replace(/^rl:/, \"\"));\nif (lastRemaining > 0 && lastRemaining <= 5) process.exit(0); // low budget\n\nconst seen = new Set(rest.filter(Boolean));\nconst { items } = await x.searchPage(QUERY, 10, \"Latest\");\n\nconst fresh = items.filter((t) => t.id && !seen.has(t.id));\nfor (const t of fresh) {\n  console.log(`[${t.author ?? \"unknown\"}] ${t.text}\\n${t.url}`);\n  if (LOG) appendFileSync(LOG, `- **${t.author ?? \"unknown\"}** — ${t.text}\\n  ${t.url}\\n`);\n  seen.add(t.id);\n}\n\nconst rl = x.getLastRateLimit();\nwriteFileSync(STATE, `rl:${rl?.remaining ?? \"?\"}\\n${[...seen].join(\"\\n\")}`);\n```\n\nIn Hermes this is a cron job with `no_agent`: the script runs on schedule and\nits stdout is delivered verbatim — silent when nothing is new, so you only\nhear about fresh tweets:\n\n```bash\nmkdir -p ~/.hermes/scripts\ncp examples/watch.mjs ~/.hermes/scripts/watch-x.mjs\nhermes cron add watch-x --schedule \"every 15m\" \\\n  --script ~/.hermes/scripts/watch-x.mjs \\\n  --no-agent --deliver origin\n# exact flags: hermes cron add --help\n```\n\nSet `AUTH_TOKEN` / `CT0` in the environment the Hermes scheduler runs in.\nIntervals: 10-15 minutes is the safe 24/7 default; 1-5 minutes works for\nnear-real-time (the web app itself polls every ~30-60 s). The example skips a\ntick silently when the rate-limit budget runs low — tune it with\n`getLastRateLimit()`. Set `WATCH_LOG` to append every new tweet to a markdown\nfile: that file becomes the long-running conversation. To keep every cron\ndelivery in one chat thread instead, enable the job's `attach_to_session`\noption (see `hermes cron add --help`). `STATE` is relative to the job's\nworking directory.\n\n---\n\n## Use the tool defs with the Vercel AI SDK (or any framework)\n\nThe tool definitions are exported runtime-agnostic (Zod schema + `execute`), so you\ncan use them in any agent runtime, not just MCP:\n\n```ts\nimport { XClient } from \"x-agent-sdk\";\nimport { tools } from \"x-agent-sdk/tools\";\nimport { tool } from \"ai\";\nimport { z } from \"zod\";\n\nconst x = new XClient();\n\nconst aiTools = Object.fromEntries(\n  tools.map((t) => [\n    t.name,\n    tool({\n      description: t.description,\n      parameters: z.object(t.inputSchema),\n      execute: (args) => t.execute(x, args),\n    }),\n  ]),\n);\n\n// generateText({ model, tools: aiTools, prompt: \"post a tweet about ...\" })\n```\n\n---\n\n## Reliability notes\n\n- **`344` / `429` handling.** On `344` (anti-bot) the client rebuilds the\n  transaction generator and backs off exponentially; on HTTP `429` it honors\n  `x-rate-limit-reset`. The `344` *daily-limit* message is almost always the header,\n  not a real quota — tweet length is irrelevant.\n- **queryIds** in `QID` can go stale; if a call starts returning `400`, re-capture\n  the current ones from X's web bundle.\n- **`TweetDetail` needs full variables + `fieldToggles`** or X returns\n  `\"...must be defined\"`. `getTweet` already sends the validated set.\n- **TLS fingerprint.** `fetch` doesn't mimic Chrome's JA3. The transaction-id clears\n  the common blocks, but for very high sustained volume a real browser (Playwright)\n  remains the safest transport — or pass a curl-impersonate wrapper via the `fetch`\n  option to speak with Chrome's TLS fingerprint.\n\n---\n\n## Project layout\n\n```\nsrc/\n  transaction.ts   x-client-transaction-id generator (zero third-party crypto)\n  accounts.ts      MCP account loading (X_ACCOUNTS / AUTH_TOKEN+CT0)\n  client.ts        XClient — typed methods, 344/429 backoff\n  tools.ts         25 runtime-agnostic tool defs (Zod schemas)\n  mcp.ts           MCP stdio server (bin: x-agent-mcp), multi-account routing\n  index.ts         public exports\ndist/              compiled output (what actually runs)\n```\n\n## License & disclaimer\n\nMIT — see [`LICENSE`](./LICENSE), which includes a **use-at-your-own-risk notice**.\n\nUnofficial, not affiliated with X Corp. This software uses X's private API with\nyour session cookies and may violate X's Terms of Service. It can result in your\naccount being rate-limited, suspended, or permanently banned. **The author accepts\nno responsibility for any bans, damages, or losses** — you use it entirely at your\nown risk and are solely responsible for complying with X's ToS and applicable law.\nFor educational and personal use only.\n","readmeFilename":"README.md"}