On 6 September 1816 he was appointed assistant surgeon on the Honourable East India Company's Bombay establishment. He was moved to Persia in 1819. He received his licence as a surgeon on 1 May 1824 and retired from the medical service on 4 June 1836, thereafter concentrating on the diplomatic aspects of the East India Company. He was attached to the field force under Colonel East in Kutch and Okamundel in 1818–19 and was afterwards deputy medical storekeeper at the presidency.
Persia
From 1824 to 1835, he was attached to the East India Company's legation in Persia, at first in medical charge, and latterly as political assistant to the Minister, John Macdonald Kinneir, in which post he displayed great ability. For instance, in 1829 he was probably one of the instigators of the murder of Alexander Griboyedov by Persian mob in Teheran. On 30 June 1835, he was appointed secretary of the special embassy sent to Tehran under Henry Ellis to congratulate Mohammad Shah Qajar on his accession to the Persian throne. McNeill received permission to wear the Persian Order of the Lion and the Sun of the first class, and on his return home in the spring of 1836, he anonymously published a startling anti-Russian pamphlet, Progress and Present Position of Russia in the East. From 1836 to 1844, McNeill was any envoy to Persia. See Siege of Herat.
At the outbreak the Crimean War in 1854, McNeill published revised editions in French and English of his pamphlet Progress and Present Position of Russia in the East, with supplementary chapters dealing with the progress of events since 1836, and insisting on the importance to Britain and to Christendom of the autonomy of Turkey and Persia. At the beginning of 1855, when the Crimean disasters had roused public indignation, McNeill and Colonel Alexander Tulloch, an officer of great administrative experience at the War Office, were sent to the Crimea with instructions to report on the whole arrangements and management of the commissariat and the method of keeping accounts, and to the causes of the delays in unloading and distributing clothing and other stores sent to Balaklava. The commissioners started at once for the seat of war. They took no shorthand writer with them, as the remuneration sanctioned by the Treasury was insufficient to secure a qualified person. The McNeill–Tulloch inquiry was the most effective of the various inquisitions into the Crimean débâcle. It sharply criticised Lord Raglan's personal staff in the Crimea and Commissary-General Filder, and it led to many recriminations as officers sought to clear their names when the report was published in 1856. A board of general officers was convened to clear the army, but despite its protestations, the McNeill–Tulloch report led to professional reform of the commissariat by the Royal Warrant of October 1858. Very unusually, the Commons, irritated by executive obfuscation, passed a resolution in 1857 calling for special honours and McNeill soon became a Privy Councillor and Tulloch was appointed a KCB. The University of Oxford made McNeill a Doctor of Civil Law and the University of Edinburgh chose him as chairman of its amalgamated societies; his inaugural address on competitive examinations was published in 1861.
Personal life
McNeill married, firstly, in 1814, Innes Robinson, fourth daughter of George Robinson of Clermiston, Midlothian – she died in 1816; secondly, in 1823, Eliza Wilson, third daughter of John Wilson – she died in 1868; thirdly, in 1871, Lady Emma Augusta Campbell, daughter of John Campbell, 7th Duke of Argyll. McNeill was the brother-in law of the author John Wilson, and of George Campbell, 8th Duke of Argyll. McNeill died at Poralto near Cannes in France, on 17 May 1883. A memorial to his memory lies on the south-east wall of Liberton Cemetery in Edinburgh, at the grave of his third wife, Emma Augusta.